C++

Preprocessor & macros (#define)

Në shqip: Paraprocesori dhe makrot

ShpjegimiSQ

Paraprocesori e lexon kodin para kompajlerit dhe zbaton komandat me # — #include, #define, #ifdef. #define krijon makro që zëvendësohen si tekst. Në C++ modern preferohen const dhe funksionet, sepse makrot s'kontrollohen nga kompajleri.

EnglishEN

The preprocessor reads the code before the compiler and carries out the # commands — #include, #define, #ifdef. #define creates macros that get replaced as text. In modern C++, const and functions are preferred, because macros aren't checked by the compiler.

Si ta mendosh

Si funksioni „gjej dhe zëvendëso“ në Word, që ekzekutohet mbi gjithë hartimin para se t'ia dorëzosh mësueses.

Lexoje në anglisht

Like Word's “find and replace” run over your whole essay before you hand it in.

Shembull kodicpp

#define MAX 100
#ifdef DEBUG
    std::cout << "Po testojmë...\n";
#endif

Terma të lidhur