Bonsoir à tous,
J'ai une erreur dans mon code dotn jai pas trouvé une solution
Code:
1
2
3
4
5
6 void SetMotCompact(MotCompact *This, char const *sczMot) { assert(This!=NULL); This->sczMot = sczMot; This->nbTermes=nbmots(sczMot); }
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 int nbmots(char lng[]) { int i; int nb=0; int espace=0; for(i=0;i<strlen(lng);i++) { if (lng[i]!=' ' && espace==0) { nb++; espace=1; } if (lng[i]==' ') espace=0; } return nb; }
Des idées svp? merci :)Citation:
attention : passing argument 1 of ‘nbmots’ discards qualifiers from pointer target type|

