It might be useful to some of us
Introduction:
Before a C++ program gets compiled by the compiler, the source-code gets processed by the compiler. This technique is called preprocessor.
This technique is not a part of the compiler but it is a separate method that comes under compilation process. It directs the compiler that the information should be preprocessed before the actual compilation starts.
All preprocessor directives in C++ begin with #, and they do not need to end with a semicolon(;) because this is not a statement in C++.
Look at the following piece of code in C++:
#include <bits/stdc++.h>
#ifndef ONLINE_JUDGE
#define macro1
#define macro2
...
#include "local_header1.h"
#include "local_header2.h"
...
#endif
//.....//
#ifndef stands for if_not_defined
#ifdef stands for if_defined
One can use preprocessor directives to make more debugs through your local device.
One can define some specific header files only to be used in local device not on online_judge
One can use macro as flags inside these #ifndef or #ifdef containers
Examples:
(1)
#ifndef ONLINE_JUDGE
#define covid19 text
#endif
#ifdef covid19
cout<<"Yes, its corona";
#endif
(Here, we used covid19 as flag to print something.)
(2)
Thanks to Errichto as I learned from him on YouTube
https://github.com/Errichto/youtube/blob/master/atcoder-dp/g.cpp
(You can see on the above link he used #ifdef LOCAL for debugging, this will print stuffs local to the device)
For more information consider the following links
https://gcc.gnu.org/onlinedocs/cpp/Macros.html
https://en.wikipedia.org/wiki/C_preprocessor
Image source https://www.w3schools.in/cplusplus-tutorial/preprocessor/