>My question is: what is the char* format?
Here's a quick example of breaking a string into variables with sscanf.
Code:
while ( fgets ( buffer, (int)sizeof buffer, INPUT ) != NULL ) {
if ( sscanf ( buffer, "%d,%d", &record.id, &record.idle ) == 2 ) {
printRecord ( &record );
else {
fprintf ( stderr, "ERROR %d: Invalid data input\n", errno );
cleanUp( &record, INPUT );
return EXIT_FAILURE;
}
}
>Why won't this work?
#declare isn't a valid preprocessor directive, there's no point in redefining a keyword with the same name. Labels end with a colon, not a semicolon, main returns an int and conio should be surrounded with <>, not " " since it's a library that comes with your compiler, not a header that you defined yourself.
Code:
#include <conio.h>
#define goto goto /* Serves no purpose */
int main(void)
{
A:
clrscr();
goto A;
return 0;
}
-Prelude