bonjour, j'ai un pb avec un code, la fonction scanf me renvoie "P" à chaque fois.
quelqu'un a une idée ?
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 #include <stdio.h> void main(void){ char mot[20]; int i,j,c; FILE * sortie; printf(" la base s\' appellera base.text\n"); sortie=fopen("base.text", "a"); printf("mot à ajouter : "); scanf("%20s",mot); fprintf(sortie, "%c\n", mot); while ((c=getchar()!=EOF)); fclose(sortie); }
Partager