Re: empty parameterized macro



John Goche writes:
I would like to know whether there is any difference between
the macro

#define FOO

and the parameterized macro taking no parameters

#define FOO()

They are called differently. The first is called as just FOO, the
second is called as FOO(). With the second, 'FOO' without () after it
is not expanded at all. If you want to define a constant, you'll
typically define FOO. If you define something which evaluates at
run-time, it looks more informative if you define FOO().

#define FOO one
#define BAR() two
#define BAZ BAR
Now the code
FOO w BAR x BAR() y BAZ() z
expands to
one w BAR x two y two z

--
Hallvard
.



Relevant Pages

  • Re: Insert with response
    ... FooBar, there's no way and no need to put them in synch. ... column in the foo table to 250 calumns in the bar table. ... set statistics time off ...
    (microsoft.public.sqlserver.programming)
  • Re: Magic function
    ... processing objects created in root at depth 3 ... root obj2 at depth 3 ... processing objects created in foo at depth 2 ... processing objects created in bar at depth 0 ...
    (comp.lang.python)
  • Re: from __future__ import absolute_import ?
    ... foo not in bar ... Unfortunately this is a side effect of using the os's directory structure to represent a python "package" structure. ...
    (comp.lang.python)
  • Re: from __future__ import absolute_import ?
    ... foo not in bar ... A path below the package level is generally a good means to shoot ... to represent a python "package" structure. ...
    (comp.lang.python)
  • Re: how to deserialize variable element/node
    ... string bar; ... In the first deserialization case, bar = "sometimes a simple string is ... Your two XML fragments would have to be represented in an XML schema by ...
    (microsoft.public.dotnet.xml)