36ee1e2015-10-12Pontus Östlund <!doctype html>
286efd2012-03-24Henrik Grubbström (Grubba) <html> <head>
36ee1e2015-10-12Pontus Östlund  <meta content="width=device-width, initial-scale=1" name="viewport">
7e5ead2016-01-20Pontus Östlund  <meta charset="utf-8">
286efd2012-03-24Henrik Grubbström (Grubba)  <title>Pike Reference Manual - #define</title>
0780872016-10-04Pontus Östlund  <!-- 221-->
36ee1e2015-10-12Pontus Östlund  <link rel='stylesheet' href='../../style.css'> <script src='../../site.js'></script>
0780872016-10-04Pontus Östlund  <script src='../../constants.js'></script> <script>PikeDoc.NO_DYNAMIC = true;</script>
286efd2012-03-24Henrik Grubbström (Grubba)  <style type='text/css'> svg line { stroke:#343434; stroke-width:2; } svg text { fill:#343434; } svg a { fill:#0768b2; text-decoration: underline; } </style> </head>
36ee1e2015-10-12Pontus Östlund  <body>
286efd2012-03-24Henrik Grubbström (Grubba)  <header>
36ee1e2015-10-12Pontus Östlund  <div class="header">
0e3f092016-04-19Henrik Grubbström (Grubba)  <div id="version"><strong data-id="version"></strong></div>
7e5ead2016-01-20Pontus Östlund  <div id="burger">&#9776;</div><!-- Hamburger icon --> <h1>
0e3f092016-04-19Henrik Grubbström (Grubba)  <a href="http://pike.lysator.liu.se/" class="logo">
7e5ead2016-01-20Pontus Östlund  <span>Pike programming language</span> </a> </h1>
286efd2012-03-24Henrik Grubbström (Grubba)  </div> </header>
36ee1e2015-10-12Pontus Östlund  <div id="page">
286efd2012-03-24Henrik Grubbström (Grubba)  <div class="navbar">
36ee1e2015-10-12Pontus Östlund  <nav>
7e5ead2016-01-20Pontus Östlund  <div class="inner" id="navbar">
36ee1e2015-10-12Pontus Östlund  <a href='../../index.html'><b class='top head'>Top</b></a>
286efd2012-03-24Henrik Grubbström (Grubba) <a href='../../ex/cpp_3A_3A.html'><b class='head'>cpp::</b></a> <script></script> <noscript> <div class='sidebar'> <a href='../../ex/cpp_3A_3A/index.html'><b>Symbol index</b></a><br /> </div> </noscript>
36ee1e2015-10-12Pontus Östlund  </div> </nav>
286efd2012-03-24Henrik Grubbström (Grubba)  </div>
36ee1e2015-10-12Pontus Östlund  <div class="content"> <div class="navbox"> <nav> <div class="sidebar"> <a href="../../ex/cpp_3A_3A/_23charset.html" class="prev"><span>&#10148;</span> #charset</a> <a href="../../ex/cpp_3A_3A/_23elif.html" class="next">#elif <span>&#10148;</span></a> </div> </nav> </div> <div class="contentbox"> <article> <h1>Directive #define</h1>
286efd2012-03-24Henrik Grubbström (Grubba)  <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Directive</span> <span class='homogen--name'><b>#define</b></span> </dt> <dd><p><code class='directive'>#define</code></p></dd> <dt class='head--doc'>Description</dt> <dd class='body--doc'><p>This directive is used to define or redefine a cpp macro.</p> <p> The simplest way to use define is to write</p>
867f912014-11-13Henrik Grubbström (Grubba) <pre><code>#define &lt;identifier&gt; &lt;replacement string&gt;</code></pre><p>which will cause all subsequent occurances of <tt><b><i>&lt;identifier</i></b></tt>
286efd2012-03-24Henrik Grubbström (Grubba)  to be replaced with the <tt><i>&lt;replacement string&gt;</i></tt>.</p> <p> Define also has the capability to use arguments, thus a line like</p>
867f912014-11-13Henrik Grubbström (Grubba) <pre><code>#define &lt;identifier&gt;(arg1, arg2) &lt;replacement string&gt;</code></pre><p>would cause <tt><b><i>&lt;identifer&gt;</i></b></tt> to be a macro. All occurances of
286efd2012-03-24Henrik Grubbström (Grubba)  '<tt><b><i>&lt;identifier&gt;</i></b>(something1,something2d)</tt>' would be replaced with the <tt><i>&lt;replacement string&gt;</i></tt>. And in the <tt><i>&lt;replacement string&gt;</i></tt>, <tt>arg1</tt> and <tt>arg2</tt> will be replaced with <tt>something1</tt> and <tt>something2</tt>.</p> </dd></dl>
36ee1e2015-10-12Pontus Östlund  </article> </div>
286efd2012-03-24Henrik Grubbström (Grubba)  </div> </div>
36ee1e2015-10-12Pontus Östlund  <footer>
0780872016-10-04Pontus Östlund  <div id="build-date">Extracted from <strong data-id="version"></strong> as of <strong data-id="date" data-timestamp=""></strong>.</div>
36ee1e2015-10-12Pontus Östlund  </footer>
7e5ead2016-01-20Pontus Östlund  <script>PikeDoc.current = {"link":"ex/cpp_3A_3A/_23define.html","name":"#define"};</script>
286efd2012-03-24Henrik Grubbström (Grubba) <script src='../../ex/cpp_3A_3A/index.js'></script> <script src='../../ex/cpp_3A_3A/load_index.js'></script>
7e5ead2016-01-20Pontus Östlund  <script> // Tell PikeDoc that next actions are from loaded scripts PikeDoc.isInline = false; </script> </body>
286efd2012-03-24Henrik Grubbström (Grubba) </html>