Toggle navigation
Home
Forum
Files
MUDs
Paste
Wiki
Log in
MudBytes Community Forum
C and C++
/
C Macro
Reply
First
1
Last
23 Jan, 2014,
Davenge
wrote in the 1st comment:
Votes:
0
#define SOMETHING( whatever, change ) ((whatever)->(change))
Where change is a string?
or
#define SOMETHING( whatever, change ) ((whatever)->##change) ?
23 Jan, 2014,
quixadhal
wrote in the 2nd comment:
Votes:
0
The C pre-processor is a straight-up text replacement system that doesn't know much about the C language at all.
If you:
#define foo(x,y) x(y)
When you use foo:
foo(blah, 3)
It generates:
blah(3)
That's all it does… various compilers add some extra convenience things for stuff like variable arguments, __FILE__, and other extensions.
Random Picks
Dark Lair
FoxMUD
Genesis MUD
Top
Jump to
Bottom
0.0
/
2
Where change is a string?
or
#define SOMETHING( whatever, change ) ((whatever)->##change) ?