@goldenchicken
Thank you for your response.
I understand what you are saying about not being able to define a function within another function.
I note that at line 18 you have noted that what I have tried to do will not work. Perhaps if I explain what I am trying to do, you may be able to help.
The idea is to enter an number at the prompt and check if it is an integer ( I will also want to do something similar with floating point numbers). If it is the program moves on. If it isn't an integer (say the user has entered a letter in error) I want it to simply go back to the prompt so that the user can re-enter the number. It is easy in BASIC but I am finding it not so easy in C++.
With my "This won't work" I meant: What happened in that case was that, when the user entered something that is not an integer, the isInterger function will be called an infinite amount of times, as your code says:
1 2 3 4 5 6 7
bool isInteger(string s)
{
if(/*Check if integer*/)
returntrue;
else
isInteger(s) /*This will check again, but as nothing has changed, this will continue to be executed*/
}