21 lines
398 B
C
Raw Normal View History

2020-05-01 23:58:52 +02:00
/// M311 - demonstration : gets, strtok
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
int main()
{
char *mot;
char *ligne = malloc (80);
ligne = fgets (ligne, 80, stdin);
printf("===%s===\n", ligne);
mot = strtok (ligne, " ");
while (mot != NULL)
{
printf("%s\n", mot);
mot = strtok (NULL, " ");
}
return 0;
}