macros c++ code example
Example 1: cpp macro
#define PRINT(x) std::cout << x << std::endl
Example 2: define in cpp
#include <iostream>
// macro definition
#define LIMIT 5
int main()
{
for (int i = 0; i < LIMIT; i++) {
std::cout << i << "\n";
}
return 0;
}