Search This Blog

Thursday, January 6, 2011

C++: Defining names in place of "true" and "false" for bool type

Programmer Question

I am wanting to use a bool to switch back and forth between loading X and loading Y from a file. I don't want to use "true" and "false", because it doesn't make the code clear. I would rather use something like LOAD_X or LOAD_Y... Is the following code the way to do it? Or is there a better way?



#define LOAD_X true
#define LOAD_Y false


Thanks.



Find the answer here

No comments:

Post a Comment

Related Posts with Thumbnails