Since about half of the last ten posts have been failure to use printf and scanf correctly, I thought I'd give you a tutorial:
1) printf is used for output. All of the *printf functions work basicly the same way:
printf( "format specifier", variables, variables, variables... );
Example:
int i = 10;
float f = 11.11;
char c = 'c';
char *s = "string";
To display this:
printf( "I is %d, F is %f, C is %c, and S is %s\n", i, f, c, s );
2) scanf works the exact opposite. All of the *scanf functions work basicly the same way:
scanf( "format specifier", ptr2var, ptr2var, ptr2var... );
int i = 0;
float f = 0.0;
char c = 0;
char s[1024] = { 0 };
scanf( "%d %f %c %s", &i, &f, &c, s );
Notice that we require pointers, so on non-pointer variables, we must use the "address of" operator. Ie: the &.
See, that wasn't so tough.
Quzah.