Bonjour,
Petite question, je ne comprends pas le retour de mon code.
Le code m'affiche <Null>.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { char statut, continuer[] = "O"; char texteStatutPrint; printf("\n C : Celibataire\n M : Marie\n S : Separe\n V : Veuf" "\n\n Veuillez saisir votre statut matrimonial :"); scanf("%c",&statut); switch (statut) { case 'C' : {char texteStatutPrint[] = "Celibataire";break;} case 'M' : {char texteStatutPrint[] = "Marie";break;} case 'S' : {char texteStatutPrint[] = "Separe";break;} case 'V' : {char texteStatutPrint[] = "Veuf";break;} default : {char texteStatutPrint[] = "Indetermine";} } printf("\n %s :",texteStatutPrint); }
Savez vous pourquoi ? Sachant que je n souhaites pas intégrer le printf au sein du Switch.
Merci beaucoup
Partager