Need help with the if statement
I made this calculator program here the beginning of it.
Code:
#include <iostream>
#include <string>
using namespace std;
int main() {
float FirstNumber;
char Sign;
float SecondNumber;
cout << ">";
cin >> FirstNumber >> Sign >> SecondNumber;
return(0);
}
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.....
in my head it looks like this...... Ya it doesn't work because if it did I wouldn't be posting this...
Code:
if ( ( FirstNumber == (char) || SecondNumber == ( char ) ) {
something....
}
Thanks....