I have the following code in the header file:
enum {false,true};
and I have the main function main.c. if I change the extension to main.cpp I get the following error:
Error C2059: syntax error 'constant'
I use visual C ++, any idea why`?
true and false are keywords representing constant values ββin C ++. You cannot use them to denote things like enumeration values.
true
false
As an example, the following:
enum { false_, true_ }; int main() {}
false and true are fallback words in C ++. You cannot override it as a variable.
Source: https://habr.com/ru/post/1500533/More articles:Selenium Grid: communication error with remote browser. He may have died - selenium-webdriverGet Gmail ID for user on Android - androidHow to make the same types with different behavior in Haskell? - graphWhy is my function static variable never different, despite the increase? - cSymfony 2.1+ encodes hash / pound "#" in routes - symfonyCALayer clip CGContextAddArc (create slide show / pie chart) - iosWebservice from WSDL using Eclipse - eclipseHow to create uiscrollview with custom forms in ios? - iostomcat 8 javax.websockets not working - javaAdd or update an array element - javascriptAll Articles