a little help please
EDIT : NVM. I just found that I need to change
char *motTest = motRecherche;
to
char *motTest;
REQUEST CLOSE /Sorry.
So if I enter 'o', it still doesn't enter in the :
Any help please?
char *motTest = motRecherche;
to
char *motTest;
REQUEST CLOSE /Sorry.
Code:
int main()
{
int longueur = strlen("Bonjour");
char motRecherche[] = "Bonjour";
char *motTest = motRecherche;
strcpy(motTest, motRecherche);
char lettre[1];
strset(motTest,'*');
int c = 0;
int i = 0;
do
{
cout << "Entrez une lettre pour trouver le mot... : " << motTest << endl;
cin >> lettre[0];
for(i = 0 ; i<longueur ; i++)
{
if(lettre[0] == motRecherche[i])
{
motTest[i] = motRecherche[i];
cout << endl << endl;
cout << "done";
}
}
}while(c == 0);
cout << "Vous avez trouver la reponse!";
return 0;
}
Code:
if(lettre[0] == motRecherche[i])
{
motTest[i] = motRecherche[i];
cout << endl << endl;
cout << "done";
}

