I made this calculator program here the beginning of it.
I need to know if there a way to use the if statement so if FirstNumber or SecondNumber = a char then it will break or spit out a error message.....Code:#include <iostream> #include <string> using namespace std; int main() { float FirstNumber; char Sign; float SecondNumber; cout << ">"; cin >> FirstNumber >> Sign >> SecondNumber; return(0); }
in my head it looks like this...... Ya it doesn't work because if it did I wouldn't be posting this...
Thanks....Code:if ( ( FirstNumber == (char) || SecondNumber == ( char ) ) { something.... }