21 lines
398 B
C
21 lines
398 B
C
|
/// 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;
|
||
|
}
|