c++ - Error C2059: syntax error 'constant' -


this question has answer here:

i have following code in header file:

enum {false,true}; 

and have main function in main.c. if change extention main.cpp following error:

error c2059: syntax error 'constant'  

im using visual c++, idea why`?

true , false keywords representing constant values in c++. cannot use them name things such enum values.

as example, following compile

enum { false_, true_ };  int main() {} 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -