TetaTricks/code/C/fgets-simple.c

15 lines
238 B
C
Raw Normal View History

2023-07-15 09:55:13 +02:00
/*
* exemple utilisation 'fgets'
*/
#include <stdio.h>
#include <string.h>
#define TL 8
int main(int argc, char *argv[])
{
char buffer[TL+1];
while( fgets(buffer, TL, stdin) ) {
printf(" %4ld\n", strlen(buffer));
}
return 0;
}