I have a file where I keep some common switches and modes in the form of preprocessor directives, and for some reason my compiler (VC++) is giving me errors, but I don't really understand why:
But I didn't think that the rand() text itself was a function, I thought it was a preprocessor directive that only becomes a function once it is substituted elsewhere in the code. I thought preprocessor definitions have no syntax and are just text substitutions. Maybe I've misunderstood the use of these directives..
How can I achieve what I'm trying to do though? I have a condition which I've named __COMMUNITY_SECONDARY_SUBORDER_CONDITION which is evaluated elsewhere in my program:
1 2 3
//somewhere else:
if (__COMMUNITY_SECONDARY_SUBORDER_CONDITION)
//do something
Will I have to do an if/else in the code itself, replacing the entire if condition?
I should point out that this actually compiles and does seem to work, my problem is with the "cout" statements, although now that I think of it the problem is that the header was being called outside of main(), so this whole thread is kind of moot now anyway... :)