my code is not moving past the line below...actually i am making a quiz and this piece of code id checking whether the entered answer is correct, from a file.
please tell me the possible reason for the problem..
please tell me the possible reason for the problem..
Code:
getline(anss,saveans);
Code:
while(a<1)
{
getline(anss,saveans);
if (saveans == ToString(randNum))
{
getline(anss,saveans);
if (saveans == ans)
{
cout<<"correct!"<<endl;
cout<<"# next question # "<<endl;
}
else
{
cout<<"wrong answer!"<<endl; // Prints our STRING
cout<<"# next question # "<<endl;
}
break;
}
}