if (dir == 1)
{
cout << "\nYou travel west. The moon lighting your path, you walk cautiosly down the road.\nNot seeing what is in front of you, you walk straight into a hole." << endl;
cout << "\nWhat should you do?" << endl;
cout << "\n1) Jump out." << endl;
cout << "2) Climb out." << endl;
cout << "3) Call for help." << endl;
cout << "4) Do nothing.\n" <<endl;
int c1;
cin >> c1;
if (c1 == 1)
{
cout << "\nYou have decided to jump." << endl;
}
elseif (c1 == 2)
{
cout << "\nYou have decided to climb out." << endl;
}
elseif (c1 == 3)
{
cout << "\nYou have decided to call for help. Your screams attract a nearby witch from\nthe east path. She picks you up and brings you to her lair." << endl;
}
elseif (c1 == 4)
{
cout << "\nYou have decided to do nothing." << endl;
}
else
{
cout << "\nWrong answer." << endl;
}
}
After the user receives the 'Wrong answer' text, the program ends. However, i wish for the program to restart itself from a specific point. I'm using Code::Blocks and the GNU GCC compiler. How can i do this?