Course Solutions Uncategorized (Solved) : C Want Code End Detects X However Keeps Going Even Finds X String Comp Bool End Cout Ente Q29007994 . . . .

(Solved) : C Want Code End Detects X However Keeps Going Even Finds X String Comp Bool End Cout Ente Q29007994 . . . .

 

c++

I want my code to end if it detects an “x”, however, it keepsgoing even if it finds an ”x”.

string comp;

bool end;

cout << “Enter company (x to stop): “;

cin >> comp;

if (comp.find(‘x’) != string::npos)

end = true;

else

end = false;

while (end == false)

{

…………………//should continue into loop IF NO x isdetected

}

Expert Answer


An answer will be send to you shortly. . . . .

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post