go to loop

I am trying go to loop, but whenever I run this code, my program crushes, although I didn't have any errors in it. I don't know why, could anyone explain, please. What would be other way to get the same result if I want to come back to the same question after an answer from the user?

Thanks in advance!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
  #include <iostream>

using namespace std;


int main()
{
    string answer;
    string yes=yes;
    string newanswer;

    question: cout << "Do you have anything else to add? " << endl;
        cin >> answer;
            if (answer==yes)
            {
                cout <<"What would you like to add? "<< endl;
            }
            else
            { cout << "Thank you!"<<endl;

            }
        cin >>newanswer;
        goto question;


    return 0;
}
Well, to begin with, what exactly is the value of yes in line 14? Hint: look at your declaration:

string yes=. . .
was such an obvious mistake, thank you!
Topic archived. No new replies allowed.