Busted version of ex24.c with fscanf instead of fgets
This commit is contained in:
@@ -28,7 +28,7 @@ int main(int argc, char *argv[])
|
||||
char *in = NULL;
|
||||
|
||||
printf("What's your First Name? ");
|
||||
in = fgets(you.first_name, MAX_DATA-1, stdin);
|
||||
in = fscanf(stdin, "%50s", you.first_name);
|
||||
check(in != NULL, "Failed to read first name.");
|
||||
|
||||
printf("What's your Last Name? ");
|
||||
|
||||
Reference in New Issue
Block a user