25 lines
447 B
C
25 lines
447 B
C
|
/* Les strings */
|
||
|
|
||
|
#include <stdio.h>
|
||
|
#include <stdlib.h>
|
||
|
#include <string.h>
|
||
|
|
||
|
|
||
|
int main() {
|
||
|
char chaine[] = {'S', 'a', 'l', 'u', 't', ' ', 'l', 'e', 's', ' ', 'c', 'o', 'd', 'e', 'u', 'r', 's', '!', '\0'};
|
||
|
|
||
|
// Affichage de la chaîne complète
|
||
|
printf("%s\n", chaine);
|
||
|
|
||
|
// Affichage du premier mot
|
||
|
int i = 0;
|
||
|
while (chaine[i] != ' ') {
|
||
|
i++;
|
||
|
}
|
||
|
chaine[i] = '\0';
|
||
|
printf("%s\n", chaine);
|
||
|
|
||
|
|
||
|
return 0;
|
||
|
}
|