D
devphylosoff
I have cpp file with :
#if 1
#include"myfile.h"
#else
#include "libfile.h"
#endif
how it works ?
#if 1
#include"myfile.h"
#else
#include "libfile.h"
#endif
how it works ?
devphylosoff said:I have cpp file with :
#if 1
#include"myfile.h"
#else
#include "libfile.h"
#endif
how it works ?
I have cpp file with :
#if 1
#include"myfile.h"
#else
#include "libfile.h"
#endif
how it works ?
devphylosoff said:I have cpp file with :
#if 1
#include"myfile.h"
#else
#include "libfile.h"
#endif
how it works ?
[...]Any textbook on C or C++ should explain that. If condition given in #if
statement is true the portion between #if and #else will be compiled
otherwise the part between #else and #endif. (There is also #ifdef,
#ifndef, #elsif.)
rights, #if 1 is always true, so if I need switch I should use
different condition.
for example
#if sth
...
and compile with -Dsth.
it's really no way to make #if 1 equals false using -D ?
Not sure, but perhaps if you define 1 to be 0. I'm not sure of the
order of expansion though.
Chris Thomasson said:#elif
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.