is there such a thing as "go to line x of the code" in c++.
I mean.. I want to ask the person at the end if they want to do the whole process all over again for another entry... do I have to write a loop for that or is there any way I could just say"go to line x of the code"?
#include <iostream>
#include <string>
int main()
{
do
{
//PROGRAM PIECE TO REPEAT HERE
string answer;
cout << "Do you want to do the process again? ";
cin >> answer;
}while(answer == "yes" || answer == "Yes")
}
It's said to try and avoid the goto feature. Although it can be extremely effecient in very rare cases, this is usually isn't the case and has large side effect of being dangerous and bug prone.