Wednesday, December 02, 2015

See Plus?

I got this from a French conversation partner who is working on his accreditation in the C++ language.  His question:  what's wrong with this?


#include

int voyelle (char *ChLue, char *Voyelle, int *nbV);
int voyelle (char *ChLue, char *Voyelle, int *nbV)
    {
        int i=0;
        printf("%s",Voyelle);
        while(ChLue[i]!='\0')
        {
            i++;
        }
        return i;


    }
int main(void)
    {
    char ChLue[256],Voyelle[6]="AEIOUY";
    int nbV=0,nbcaractere=0;
    printf("saisir une chaine de caractere");
    scanf("%255s",ChLue);
    //printf("%s",Voyelle);
    nbcaractere=voyelle (ChLue,Voyelle,&nbV);
    printf("%d\n",nbcaractere);
    return 0;
    }





Ummm......

No comments: