main() generally has int type. If you want to go back to beginning, I can think of two ways. First, is using "goto". Second is using a while loop. You can also include a conditional statement at the end (before system("pause")) to exit the program when you wish. I'll give you an example of this. I apologize for not taking time to align brackets.
int a = 1; //Defined an int of type
cout << "enter 0 to exit and 1 to continue " << endl;
cin >> exit_status;
if (exit_status == 0)
else //not needed but whatever.
I believe the command line for that is system("CLS");
I was checking some other forums and found this. This might be better since it was posted by pretty well known people on this forums.
cout << string(50, '\n');
I hope it helps.
Hahaha yes, but calculator programming is definitely an easy way to get sucked into the programming world but when you begin to learn about Object Oriented Programming you will have a hard time going back to the calculator because of how limited it is and your mind may not be able to switch back to a non-"dynamic" language. Welcome to the world of C++ by the way.
You're not wrong, I was just curious, 4 years of programming and I'd never considered calling the main for any reason. Why does it eat up memory? Does re-declare variables without them passing out of scope somehow?