go to line?

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"?
There's no way to "go to line x of code" but you can use goto keyword or a 'while' loop.
Simply make a while loop, Null is correct.

1
2
3
4
5
6
7
8
9
10
11
12
13
#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")
}
closed account (S6k9GNh0)
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.
Topic archived. No new replies allowed.