0
I’m trying to make a noose and on that part, always gives the core error dumped. how can I solve this problem?
cout << newnome1 << ", ESCOLHA UMA PALAVRA: ";
cin >> palavraSecreta;
while(tela[j] != '\0') {
j++;
tam++;
}
for(j=0; j<tam; j++) {
tela[j] = '_';
}
while(max <= 5) {
for(j=0;j<tam;j++) {
cout << tela[j];
}
cout << "\n\nDigite uma letra: ";
cin >> letra;
for(j=0;j<tam;j++){
if (letra == palavraSecreta[j])
tela[j] = letra;
else
cout << "letra errada, tente novamente" << endl;
max++;
}
}
I cannot replace string letters to "" and then print the "" or replace the "_" with letters. I’ve seen several tutorials and keeps giving same error.
I appreciate any help.