Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
I have some old code that tries to construct identifiers with a macro like ...
I have some old code that tries to construct identifiers with a macro like
#define Paste(a, b) a/**/b
but it doesn't work any more.
✍: Guest
It was an undocumented feature of some early preprocessor implementations (notably Reiser's) that comments disappeared entirely and could therefore be used for token pasting. ANSI affirms (as did K&R1) that comments are replaced with white space, so they cannot portably be used in a Paste() macro. However, since the need for pasting tokens was demonstrated and real, ANSI introduced a well-defined token-pasting operator, ##, which can be used like this:
#define Paste(a, b) a##b
Here is one other method you could try for pasting tokens under a pre-ANSI compiler:
#define XPaste(s) s
#define Paste(a, b) XPaste(a)b
2016-01-27, 1091👍, 0💬
Popular Posts:
What will be printed as the result of the operation below: main() { int x=5; printf("%d,%d,%d\n",x,x. ..
Example of using Regular Expressions for syntax checking in JavaScript ... var re = new RegExp("^(&a...
How To Set Up Breakpoints in Debug Mode? - Oracle DBA FAQ - Introduction to Oracle SQL Developer To ...
How To Blend a Color Layer to a Image? - PSP Tutorials - Fading Images to Background Colors with PSP...
Do You Know the Book "JUnit in Action"? You should know this book. It received some good reviews. Ti...