cout<<"Type the offers till you type '0' for end"<<endl;
do
{
cout<<"Type the name of the buyer:"<<endl;
cin>>av;
cout<<"Type the price"<<endl;
cin>>ce;
}
while(av[0]!='0');
What I want to do here is, read offers, till the users types '0' (zero) for END.
I try typing 0, but it doesn't stop :/
simply add a if statement to check for '0' input before asking for other input
1 2 3 4 5 6 7 8 9 10 11 12
cout << "Type the offers till you type '0' for end" << endl;
do
{
cout << "Type the name of the buyer:" << endl;
cin >> av;
if (av[0] != '0')
{
cout << "Type the price" << endl;
cin >> ce;
}
}
while(av[0] != '0');