To tylko jedna z 2 stron tej notatki. Zaloguj się aby zobaczyć ten dokument.Zobacz
całą notatkę
Podgląd dokumentu
Fragment notatki:
Solution Simple method: read and dump all the characters from the input buffer until a '\n' after the scanf() call: void dump_line( FILE * fp ) { int ch; while( (ch = fgetc(fp)) != EOF && ch != '\n' ) /* null body */ ; } Modified code int x; char st[31]; printf("Enter an integer: "); scanf("%d", &x); dump_line(stdin); /*
... zobacz całą notatkę
Komentarze użytkowników (0)