1
#include <iostream>
#include <locale.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
using namespace std;
int main()
{
setlocale(LC_ALL, "portuguese");
int idade[20];
string nome[20];
char sexo[20],expe[20];
for (int i=0; i <3; i++){
do{
cout << "digite o seu " << i+1 <<"º nome, idade, sexo e se tem experiência no serviço: ";
cin >> nome[i];
cin >> idade[i];
cin >> sexo[i];
cin >> expe[i];
}while (strcmp(nome, ab)); /* está linha é que está com problema*/
}
return 0;
}
"this line is in trouble" -> what problem? That is, what error occurs? P.S.: wouldn’t be the variable
ab
, that is not defined anywhere?– Luiz Vieira
There are some problems, the first is that this does not seem to have any goal. Why do you need to do this? Explain the goal, the whole logic must be wrong. And I’ve told you not to mix C with C++.
– Maniero
is that I don’t know straight what is C and what is C++. The logic is to exit the loop once the "name" variable is set to 0.
– Ricardo Rodrigues
Start studying these things. Shooting away everywhere, without a goal, without a path mapped out, won’t get you anywhere. You will delude yourself into thinking you are learning something and will only be following formulas that will be of no use in practice. What you’re trying to do doesn’t make sense, the problem is there. But if you insist I’ll fix the syntax.
– Maniero