Oct 8, 2013 at 5:07am
how do i stop the loop?
1 2 3 4 5 6 7 8 9 10
|
int main()
{
string str;
while(str != "\n")
{
cout<<"Insert data or a blank line to quit:\n";
getline(cin,str);
//run code that checks/reads data
}
}
|
Last edited on Oct 8, 2013 at 5:09am
Oct 8, 2013 at 5:33am
ah I see. Totally forgot about that .empty() function.. Thanks