Как сделать новый старт после цикла
int main() { //During loop, my program will skip this section and start straight from second paragraph. cout << "Hey there, what shall i call you?" << endl; getline(cin,name); system("cls"); cout << "Hey " << name << ".\nToday I will help you on calculating the cost of petrol you need to pay for a round trip.\n"; system("pause"); system("cls"); Info(); Graphics(); system("pause"); bool input = 1; while(input) { char choice; cout << "Do you want to try again? (y/n)" << endl; cin >> choice; switch(choice) { case 'y': input = 0; main(); return 0; break; case 'n': cout << "huehuehuehuehue bye!"; input = 0; break; default : cout << "invalid input." << endl; input = 1; break; } } }
Что я уже пробовал:
Я ничего не пробовал.
0x01AA
Может быть, внешняя петля?