Re: Restarting the program
Don't think of it as "restarting the program". Just use a loop to jump back to the thing you want to do repeat in order to fix the input.
Re: Restarting the program
Simple approach to repeat the same goes here..
Code:
char c;
do
{
//your code which should repeat..
cout<<"continue (y/n): ";
cin>>c;
}while (c!='n');
Re: Restarting the program
And concept of restarting the whole program ie: the exe is complex but can be achieved. But for a simple console application I think I answered what you needed.
Re: Restarting the program
If you want to break out and restart your program from anywhere, then a try-catch construct might be better addapted than a plain while loop.
In any case, make sure your constructs are RAII (or make sure you correctly clean-up) to avoid memory leaks.
The usual alternative is to just exit the program, and have it restart from an external source. That's what 99% of command line apps do.