0
What is macro in c++?
2 ответов
+ 4
You can define a macro at the beginning of file. They are used to make code shorter and easy to read.
#define FOR(a) for(int i = 0; i < a; i++)
means, that you just write FOR(10) in your code and that will be just like if you write
for(int i = 0; i < 10; i++)
This macro also shouldn't be used in development, but it is good when you need to type code fast. Hope you got the idea :)
+ 2
inline functions in c++ work same as macro in c