Search:

Type: Posts; User: sparkomemphis

Page 1 of 4 1 2 3 4

Search: Search took 0.01 seconds.

  1. __attribute__((format(printf, for function pointers in Clang C

    In gcc I see __attribute__((format(printf warnings for function pointers


    prompt > gcc -Wall m.c
    m.c: In function 'main':
    m.c:117: warning: too few arguments for format
    m.c:118: warning: too...
  2. Replies
    2
    Views
    564

    one uses -> when one has a pointer to a struct. ...

    one uses -> when one has a pointer to a struct.
    Example.



    typedef struct
    foo
    {
    int bar;
    } FOO;
  3. The answer is in this example , it's up to the...

    The answer is in this example ,
    it's up to the reader to figure out which one.



    prompt > cat d.c ; gcc -Wall -g d.c -o d ; ./d
    #include <stdio.h>

    #define PRINT_INT_EXP(xx_exp) \
    ...
  4. Replies
    5
    Views
    1,371

    what happens when the user enters 0 for a ?

    what happens when the user enters 0 for a ?
  5. Replies
    11
    Views
    1,621

    is img an array ?

    is img an array ?
  6. Replies
    3
    Views
    1,167

    what is sizeof( struct PPMPixel ) ?? printf("...

    what is sizeof( struct PPMPixel ) ??
    printf(" sizeof( struct PPMPixel ) = %d\n", sizeof( struct PPMPixel ));
    if it is 4 that is your problem.
  7. Your History also needs checking 1920 was in...

    Your History also needs checking
    1920 was in the 20th century!



    #ifdef ALWAYS_BREAK
    if (attempt>0)
    printf("will always break out of switch\n");
    break;
    #else
  8. Replies
    16
    Views
    1,732

    the code at line 42 waste cpu cycles. ...

    the code at line 42 waste cpu cycles.
    line[strlen(line)-1] = '\0';
    strlen iterates through a string until it finds a string terminator ( aka '\0' )
    so the string line already has a string...
  9. its only big enough to hold 1 char "kg", "lb"...

    its only big enough to hold 1 char "kg", "lb" require 3 .
  10. &unitChoiceWeight is not big enough to hold...

    &unitChoiceWeight is not big enough to hold useful string.
  11. Replies
    8
    Views
    1,948

    you might want to tell the compiler that

    you might want to tell the compiler that
  12. Replies
    8
    Views
    1,948

    at line 38 WHEN will arr[i] be greater than max...

    at line 38 WHEN will arr[i] be greater than max ???
    you have problems at lines 35 and 37
    also how big is hrr ??
  13. Replies
    16
    Views
    3,551

    on line 6 what is the function input() and why...

    on line 6 what is the function input() and why are you passing the address of a string constant ?
    on line 7 what is lin ?
  14. Replies
    6
    Views
    1,742

    at line 26 you need to get out of the for loop or...

    at line 26 you need to get out of the for loop or the next iteration of for loop will set check =1;
  15. Replies
    5
    Views
    21,299

    If it was correct , which is is not, and someone...

    If it was correct , which is is not, and someone inputted -1 for i, the loop would terminate.
    since for some reason you increment i.
  16. Replies
    16
    Views
    2,493

    on lines 10 & 11 m and/or k could be 0 which...

    on lines 10 & 11 m and/or k could be 0 which would mean you would be swapping the first letter of the word.


    m = rand() % (strlen(str)-1);
    k = rand() %...
  17. Ryan Gregg, Tell us what the value of...

    Ryan Gregg,
    Tell us what the value of validInput should be before and after each line 11-14
  18. Replies
    3
    Views
    1,677

    For a small set like age I would just use an...

    For a small set like age I would just use an array of char




    int
    have_seen_age(unsigned int age)
    {
    static char age_used[128] = { 0 };
  19. Replies
    4
    Views
    4,342

    How does phonebook in main get updated by AddNew ?

    How does phonebook in main get updated by AddNew ?
  20. Replies
    3
    Views
    781

    The calculation of *d at line 57 is wrong HINT...

    The calculation of *d at line 57 is wrong
    HINT what should *d be for 366 total days, ? for 365 total days ?
  21. Replies
    3
    Views
    1,005

    Where is the call to even_odd(...) ? line 21 is...

    Where is the call to even_odd(...) ? line 21 is not a function call , it's a prototype.
  22. what do you intend to do on line 62 and line 69 ?

    what do you intend to do on line 62 and line 69 ?
  23. on lines 10,15,18, ... you (binbk) have ...

    on lines 10,15,18, ...
    you (binbk) have
    fgets(save, 95, fp);
    but save is only 50 chars
    so you could overwrite 45 bytes that follow save's 50 bytes.
    I would suggest doing something like:

    ...
  24. Replies
    6
    Views
    1,147

    I think you have a break where you probably want...

    I think you have a break where you probably want a continue. What happens to the loop when a user enters a negative number ?
  25. Replies
    5
    Views
    1,809

    Why is userIn static ?

    Why is userIn static ?
Results 1 to 25 of 89
Page 1 of 4 1 2 3 4