This program is part of calculator discussed in B.Stroutrup's "principles and practice using C++" book. We (actually he) made seperate function calculate() and put it into main so after receiving error we shouldnt have to quit program but instead we just get an error message and we can continue.
That sounds good but when we get an error inside calculate's() try{} we are thrown into catch(){} part of this calculate() function (right?). After we clean_up_mess() arent we supposed to be at the end of this calculate() function and than just exit it and return to main()? (Or void funtion without return; is supposed to be like infinite loop?)
I dont think so because
1 2 3
void print(){
cout << "Hello World!" << endl;
}
is working great and i dont get full screen of Hello World's.
As i understand void is not supposed to give any return value so it just executes and goes back to main(), but in this case i can continue to type expressions and get solid answers.
Could someone explain to me whats going on?