Halaman

Rabu, 13 November 2013

c++ defines, what is the meaning of that dreaded ## signs.. :)

That ## syntax maybe looks like evil, but as a lovely c++ programmer, you need to use and get familiar with that syntax

When i first saw this syntax.. the ants starts to creep on my stomach as my lack of skill in pronounces, i could not find the right keyword to google that '##' syntax.. :(

when you see something like this on some c++ header file:

#define CF(className) create##ClassName(){}


this macro if applied for example..

CF(kittyClass);

That macro, by the compiler will be translated to

createKittyClass(){};

Yep, and that is all folks.. :)