core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_macro_args.htm
changeset 0 fb279309251b
child 1641 2b3996fc09a1
equal deleted inserted replaced
-1:000000000000 0:fb279309251b
       
     1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"><html>
       
     2 <head>
       
     3 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
       
     4 <meta http-equiv="Content-Style-Type" content="text/css" />
       
     5 <meta name="LASTUPDATED" content="06/17/05 11:09:43" />
       
     6 <title>A # Not Followed by a Macro Argument</title>
       
     7 <link rel="StyleSheet" href="../../book.css" type="text/css"/>
       
     8 </head>
       
     9 <body bgcolor="#FFFFFF">
       
    10 <h3>A # Not Followed by a Macro Argument</h3>
       
    11 <p>(ISO C, &sect;6.10.3) The C compiler can accept <span class="code">#</span> tokens that do not appear before arguments in macro definitions.</p>
       
    12 <div class="listing">
       
    13   <h5>Listing 1. Preprocessor Macros Using # Without an Argument</h5>
       
    14   <p>#define add1(x) #x #1 // OK, but probably not what you wanted:<br />
       
    15     // add1(abc) creates &quot;abc&quot;#1<br />
       
    16     #define add2(x) #x &quot;2&quot; // OK: add2(abc) creates &quot;abc2&quot;</p>
       
    17 </div>
       
    18 <p>To use this feature, disable the <a href="../pragmas/p_ANSI_strict.htm">ANSI Strict</a> setting.</p>
       
    19 <p>See also &ldquo;Checking for Standard C and Standard C++ Conformity&rdquo;.<br />
       
    20 </p>
       
    21 <div id="footer">Copyright &copy; 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. <br>License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
       
    22 
       
    23 
       
    24 </body>
       
    25 </html>