im making a random question game. what im having trouble with is figuring out the correct way to make it check the answers
this is what i have.
for(int r=0; r<10; r++)
{
int theDice = ( rand() % 10) +1;
answer[theDice];
cout<<question[theDice]<<endl;
cout<<"Response: ";
cin>>inquestion;
if (strcmp(inquestion, answer[theDice]) == 0 )
cout<<"correct"<<endl;
else
cout <<"WRONG"<<endl;
}
i want it to compare what teh user inputs to what ever the roll gives. my though process? if a=a then its right but apparently c++ doesn't work that way :/. is there another way to approach it that i havent thought of or missed? or should i just go do every answer by hand like
if (answer=="Who is alex?")
cout<<"GOOD JOB";
thanks for the help