+ 3
What is the main point of #define?
What is the main point of #define, if it is a constant that allows you to replace anything you want with "turn off" some lines of code if it does not fit for something, or create a short function, but why it is actively used in all libraries and how it is on affect them?
4 ответов
+ 1
#ifndef GUARD_HEADERNAME_H
#define GUARD_HEADERNAME_H
//This header code can be included more than once.
#endif
+ 1
//In old code, bad code and rarely good code
#define WILL_BE_REPLACED(args) code that uses args;
+ 1
#define WINDOWS
#define NO_EXCEPTIONS
0
Because its permits to signal feautures (or feauture lacks) to compile-time when allow some custom automated compilation