help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: preprocessor defs on the command line


From: Paul Pluzhnikov
Subject: Re: preprocessor defs on the command line
Date: Sun, 15 Jan 2006 17:54:41 -0800
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)

"Chris" <cspears2002@yahoo.com> writes:

> How can I create preprocessor definitions on the command line?  I was
> look at the man pages, but all I found was an option for macros.

Preprocessor definitions and macros are two different names for
the same thing.

Compile your test with:

  g++ -DPI test.cc 
  g++ -UPI test.cc
  g++      test.cc

and observe the differences.

Also note, that the code you wrote is usually written this way instead:

        #ifdef PI
                cout << "PI is defined." << endl;
        #else
                cout << "PI is not defined." << endl;
        #endif

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]