Very basic C++ program issue – Invalid operands to binary expression

You’ve fallen victim to the most vexing parse, which means thisisanumber is being treated as a function. Take out the parentheses and you should be fine:

int thisisanumber;

Also consider making it a bit more readable, such as thisIsANumber. If you ever need to know it, thisIsANumber uses the camel-case naming convention.

Leave a Comment