Conditional compilation (#if, #ifdef)
Në shqip: Kompajlimi me kusht
ShpjegimiSQ
Me #ifdef, #if dhe #else, paraprocesori përfshin ose përjashton copa kodi para kompajlimit — p.sh. mesazhe debug vetëm kur kompajlon me -DDEBUG, ose kod të ndryshëm për Windows dhe Linux.
EnglishEN
With #ifdef, #if and #else, the preprocessor includes or excludes chunks of code before compiling — e.g. debug messages only when you compile with -DDEBUG, or different code for Windows and Linux.
Si ta mendosh
Si udhëzimet „nëse bie shi, merr çadër“ që zbatohen para se të dalësh.
Lexoje në anglisht
Like “if it's raining, take an umbrella” instructions applied before you leave.
Shembull kodic
#ifdef _WIN32
#define NDARESI '\\'
#else
#define NDARESI '/'
#endif