D
D
DVoropaev2017-07-24 01:12:39
C++ / C#
DVoropaev, 2017-07-24 01:12:39

How to use #define to make a replacement in the header?

Let's say we have code:

//main.cpp
#define debug 1
#include "myHeader.h"
 . . .

and here is the contents of the header file:
// myHeader.h
#if debug == 1
 . . .
#else
 . . .
#endif

How to make everything work?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
devalone, 2017-07-24
@devalone

What compiler? Your code works for me (gcc)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question