Make the program return to the last......
....................
cout<< "Enter"<<endl;
cout<< "Username: ";
cin>>user;
cout<<"Okay, you want to add " << "'" << user << "'" << "?" << "(Y or N)" << endl;
cin>>yorn;
if (yorn == "y")
{
cout <<"fasd"<<endl;
system("pause");
return 0;
}
else
{
cout<<"Return??"<<endl;
system("pause");
return 0;
}}
HOW can I make the program return to the last question asked after the user responds "n" (or something other than y)??
[727 byte] By [
akk] at [2007-11-11 7:46:08]

# 1 Re: Make the program return to the last......
first of all, you can't compare char arrays using ==. This code compiled but it certaqinly doesn't do what you expect it to. You need to use strcmp to test whether the two strings are identical.
As for displaying the last question: simply call a function that does the display stuff, and call it from two different places in the program.
Danny at 2007-11-11 21:01:58 >

# 3 Re: Make the program return to the last......
certainly, using std::string is much better.
Danny at 2007-11-11 21:03:58 >
