What does #define do here? #define syntax

Link: http://www.cplusplus.com/articles/Eyhv0pDG/

What do
1
2
  #define _INC_EKU_IO_CONCOL
  #define CONCOL 

do in the link above?

I thought the syntax must be:
#define identifier replace
--------------------------------------------------------------------
And also what if there is no namespace 'eku' in the header, just enum and functions...?
I thought the syntax must be:
#define identifier replace


If you don't supply the value when #define-ing a symbol, then the pre-processor replaces that symbol with with blank text. However, that symbol is considered to be defined for the purposes of #if / #ifdef / #ifndef tests.

It looks as though the tutorial on this site neglects to mention that, but here's one that discusses it:

http://www.cprogramming.com/reference/preprocessor/define.html

Edit:

And also what if there is no namespace 'eku' in the header, just enum and functions...?

Then those things will be declared/defined in the global namespace.
Last edited on
Topic archived. No new replies allowed.