Broke it with in 5 seconds

, do you want some input validation functions?
---------- Post added at 04:05 AM ---------- Previous post was at 04:01 AM ----------
Originally posted by Girby2K11
hey i am currently studying C++ can people give me some links what you learnt from thanks..... but anyway here is my program can you post a comment if you think it is good

also it is my first command prompt program.....
it includes: a calculator which i add your * sum up by 8 then divide it by 5....... has a lot of text.
and a age teller for getting a girlfriend like if you put your age as 23 it will say 18 <----- that is the age you have to get a girlfriend at no younger and if you put a different age if wont be 18 it would be something else
You must login or register to view this content.
this is a program i wrote
You must login or register to view this content.
Basically to make sure the user does not axidently enter a character to a number input and the program breaks, you use this (it is inside a for(;

loop, so the continue, refreshes menu.
getline(cin,input);
if(input.length()==0) //if string length is 0
continue;
//if user enters nothing (just pressed enter by mistake)
if(numberval(input)) //numberval checks if string is a valid number
{
side_a=atoi(input.c_str()); //side_a (int), atoi is a c function that converts string to number, the string we are using is a C++ string so we use .c_str() to convert it to a c string to use in a c function.
break;
}
else
{
invalid(); //must have a invalid function or just cout a message
continue;
}