On Mon, 22 Feb 1999 [EMAIL PROTECTED] wrote:

# I have an application in wich i define for example an integer that is equal
# to 3. But I want the following adjustment to my program :
# When i wanna compile my program with the -g (debug) option, i'd like that
# the integer is equal to 2. What i want is a sort of
# 
# #IFDEF __DEBUG__ THEN
# 
# #ELSE
# 
# Is this possible ?

well i just wrote this:

#include <stdio.h>

#ifdef __DEBUG__
int c = 2;
#else
int c = 3;
#endif

main() { printf ("C = %d\n", c); }

---

and if you compile it without any flags it prints 3, and if you
do 
gcc -g -D__DEBUG__ foo.c -o foo
it prints 2...

the -D__DEBUG__ is important

-- 
+++           Beware of programmers who carry screwdrivers           +++
[EMAIL PROTECTED]     http://www.users.globalnet.co.uk/~kermit

Reply via email to