Line buffered input

Nasza ocena:

3
Wyświetleń: 483
Komentarze: 0
Notatek.pl

Pobierz ten dokument za darmo

Podgląd dokumentu
Line buffered input - strona 1 Line buffered input - strona 2

Fragment notatki:

Line buffered input  Each line input is stored in a buffer  Problems can arise when a program does not process all the data in a line, before it wants to process the next line of input  Consider the following code: int x; char st[31]; printf("Enter an integer: "); scanf("%d", &x); printf("Enter a line of text: "); fgets(st, 30, stdin);  The fgets() will not read the line of text that is typed in  Instead, it will probably just read an empty line  In fact, the program will not even wait for an input for the fgets() call ... zobacz całą notatkę



Komentarze użytkowników (0)

Zaloguj się, aby dodać komentarz