Search:

Type: Posts; User: Emmanuel Delaha

Page 1 of 11 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    21
    Views
    3,032

    Please stop saying insanities...

    Please stop saying insanities...
  2. Replies
    5
    Views
    1,114

    srand() must called once and only once at the...

    srand() must called once and only once at the very begining of your code (in main(), probably).
  3. Replies
    18
    Views
    6,018

    dealdeck(deckptr , handsDelt[][52]); What do you...

    dealdeck(deckptr , handsDelt[][52]);
    What do you meant here ? It's not C.


    for(x=3;x<7;x++)
    {
    for(y=2;y<15;y++)
    {
    deckptr -> suitValue = x;
    deckptr -> faceValue = y;
  4. Replies
    18
    Views
    6,018

    First of all, you should fix that... ...

    First of all, you should fix that...


    main.c:26: warning: return type of `main' is not `int'
    main.c: In function `main':
    main.c:37: warning: array subscript has type `char'
    main.c: In function...
  5. Replies
    10
    Views
    2,105

    A floating point it generally is composed of ...

    A floating point it generally is composed of

    One sign bit
    Some bits for the mantissa
    Some bits for the exponent (one of them being the sign of it)

    The internal representation of the...
  6. Replies
    10
    Views
    2,105

    According to the standard, this clearly invokes...

    According to the standard, this clearly invokes an undefined behaviour.

    Should be


    float mydouble;

    scanf("%f", &mydouble);

    or
  7. Replies
    10
    Views
    2,105

    You meant "%lf"

    You meant "%lf"
  8. Replies
    88
    Views
    17,052

    Pass the address of the array and its number of...

    Pass the address of the array and its number of element.


    int a[3];
    f(a, 3);

    rather than the address of a single variable :


    int a;
  9. Replies
    3
    Views
    1,316

    [please, use the code tags (the [#] button)] ...

    [please, use the code tags (the [#] button)]


    A
    return 0; is missing...

    Add a
    (void) getchar(); before the return. It's a well known issue of Dev-C++. I hope it will be fixed some day,...
  10. Replies
    4
    Views
    2,090

    Sounds good to me: Enter five numbers 1...

    Sounds good to me:


    Enter five numbers 1 2 3 4 5
    arrayofints2[0]has a value of 1
    arrayofints2[1]has a value of 2
    arrayofints2[2]has a value of 3
    arrayofints2[3]has a value of 4...
  11. Replies
    88
    Views
    17,052

    Redundent. Remember my quote: Better to do...

    Redundent. Remember my quote:

    Better to do that:


    #ifndef PROGMAIL_H_INCLUDED
    #define PROGMAIL_H_INCLUDED
    #define MAX 120
    #define NUM 20
  12. Replies
    88
    Views
    17,052

    It's not 'numerous arrays'. It's ONE array of...

    It's not 'numerous arrays'. It's ONE array of numerous structures.
  13. Replies
    88
    Views
    17,052

    Why do you have two identical structure...

    Why do you have two identical structure definitions ? A mail is a mail.
    Unless you have planned some divergent evolution, you can remove the MAILR thing.

    By the way, you don't need the tags.
    ...
  14. The general idea is 'define before use'. Sticking...

    The general idea is 'define before use'. Sticking to that makes code easier to write and read.
  15. Correct. It was a last minute change on the IDE...

    Correct. It was a last minute change on the IDE that I forgot to report on my editor from wher I do the copy and paste.

    Agreed.

    Last version:

    ...
  16. Agreed.

    Agreed.
  17. VLA only works inside a block. You code is...

    VLA only works inside a block.

    You code is buggy (buffer overflow etc.)
    Try this. Ask for details if necessary


    /*******************************************************
    * Purpose: Design...
  18. Replies
    88
    Views
    17,052

    A header is not a good place for a function...

    A header is not a good place for a function (unless you have C99 and 'inline'). You really want to write this cleanup function or to write some get_line() function of your own including fgets() and...
  19. Replies
    88
    Views
    17,052

    This is the expected behaviour when you use...

    This is the expected behaviour when you use fgets() 'rawly'. It also 'catches' the '\n'. All you have to do is to 'clean-up' the string once you have got it (actually, fgets() is a 'line reader')
    ...
  20. Replies
    88
    Views
    17,052

    So you want to input several mails before saving...

    So you want to input several mails before saving them ? Unsafe, but if you insist, you can use an array of structs as mentionned elswere.

    Of course a static array has a limited size. If you want a...
  21. Replies
    88
    Views
    17,052

    - Get the info - Save the info You should...

    - Get the info
    - Save the info

    You should open your file in "a" mode. It will append to the end of it (or create it if non-existent)
  22. Replies
    88
    Views
    17,052

    Probably because you have a pending '\n' in...

    Probably because you have a pending '\n' in stdin. I guess you are using getchar() or scanf() in you menu...

    All inputs should be done with fgets().
  23. Replies
    88
    Views
    17,052

    No. I was just an example. The general idea is...

    No. I was just an example. The general idea is that when you use a structure, it's good design to pass the address of it to the functions.

    The address can be the address of some object


    void...
  24. Replies
    6
    Views
    1,481

    And of course, you will test the value returned...

    And of course, you will test the value returned by malloc() against NULL before using it.
  25. Replies
    12
    Views
    5,605

    sleep() (whatever the details) is not standard.

    sleep() (whatever the details) is not standard.
Results 1 to 25 of 267
Page 1 of 11 1 2 3 4