i'm trying to do a do while loop, to keep printing the data that matches the key of mymap.
my while statement printed an endless loop....
What should the while statement be??
my while statement printed an endless loop....
What should the while statement be??
Code:
do
{
if(mymap.find(input)!= mymap.end())
{
cout<< mymap.find(input)->second<<endl;
mymap.find(input)++;
}
else
cout<<"No word(s) found."<<endl;
}
while(mymap.find(input)!= mymap.end()); //this cause endless loop
Comment