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...
Type: Posts; User: sparkomemphis
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...
one uses -> when one has a pointer to a struct.
Example.
typedef struct
foo
{
int bar;
} FOO;
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) \
...
what happens when the user enters 0 for a ?
is img an array ?
what is sizeof( struct PPMPixel ) ??
printf(" sizeof( struct PPMPixel ) = %d\n", sizeof( struct PPMPixel ));
if it is 4 that is your problem.
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
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...
its only big enough to hold 1 char "kg", "lb" require 3 .
&unitChoiceWeight is not big enough to hold useful string.
you might want to tell the compiler that
at line 38 WHEN will arr[i] be greater than max ???
you have problems at lines 35 and 37
also how big is hrr ??
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 ?
at line 26 you need to get out of the for loop or the next iteration of for loop will set check =1;
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.
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() %...
Ryan Gregg,
Tell us what the value of validInput should be before and after each line 11-14
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 };
How does phonebook in main get updated by AddNew ?
The calculation of *d at line 57 is wrong
HINT what should *d be for 366 total days, ? for 365 total days ?
Where is the call to even_odd(...) ? line 21 is not a function call , it's a prototype.
what do you intend to do on line 62 and line 69 ?
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:
...
I think you have a break where you probably want a continue. What happens to the loop when a user enters a negative number ?
Why is userIn static ?