jeudi 27 mai 2021

How to execute a function if define in C++

Is there any way to do this

main.cpp

#DEFINE DEBUG
int main(){}

header.cpp

#ifdef DEBUG
Welcome()
#endif  
void Welcome(){
     std::cout<<"Welcome To Debug" <<std::endl;
}

Aucun commentaire:

Enregistrer un commentaire