 
    
<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>#else Archives - Complete, Concrete, Concise</title>
	<atom:link href="https://complete-concrete-concise.com/tag/else/feed/" rel="self" type="application/rss+xml" />
	<link>https://complete-concrete-concise.com/tag/else/</link>
	<description>Practical Information Without The Bloat</description>
	<lastBuildDate>Wed, 13 Jul 2011 17:39:51 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>
	<item>
		<title>Preprocessor – the #else Directive</title>
		<link>https://complete-concrete-concise.com/programming/c/preprocessor-the-else-directive/</link>
		
		<dc:creator><![CDATA[richardsplanet]]></dc:creator>
		<pubDate>Wed, 13 Jul 2011 17:39:51 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[#else]]></category>
		<category><![CDATA[preprocessor]]></category>
		<category><![CDATA[understanding]]></category>
		<guid isPermaLink="false">http://complete-concrete-concise.com/?p=898</guid>

					<description><![CDATA[<p>#else is one of five preprocessor selection statements allowing selection of alternative sections of code for compilation. The other four selection statements are: #ifdef, #ifndef, #if, and #elif. Behaviour of this preprocessor directive is the same for both C and C++ compilers. Purpose The #else directive provides a final alternative for a preprocessor selection block. [&#8230;]</p>
<p>The post <a href="https://complete-concrete-concise.com/programming/c/preprocessor-the-else-directive/">Preprocessor – the #else Directive</a> appeared first on <a href="https://complete-concrete-concise.com">Complete, Concrete, Concise</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div class="c1">
<p><code>#else</code> is one of five preprocessor selection statements allowing  selection of alternative sections of code for compilation. The other four selection statements are: <code>#ifdef</code>, <code>#ifndef</code>, <code>#if</code>, and <code>#elif</code>.</p>
<p>Behaviour of this preprocessor directive is the same for both C and C++ compilers.</p>
</div>
<h1>Purpose</h1>
<p>The <code>#else</code> directive provides a final alternative for a preprocessor selection block. If all previous selection options fail, then the code found between the <code>#else</code> and <code>#endif</code> is compiled.</p>
<h1>Format </h1>
<div class="c2">
<p><strong>#if</strong> or <strong>#ifdef</strong> or <strong>#ifndef</strong></p>
<p>preprocessor or code statements</p>
<p><strong>#elif</strong> <em>controlling_expression</em> (optional)</p>
<p>preprocessor or code statements</p>
<p> <strong>#else</strong></p>
<p>preprocessor or code statements</p>
<p><strong>#endif</strong></p>
</div>
<p>All preprocessor directives begin with the <code>#</code> symbol. It must be the first character on the line or the first character on the line following optional white space. </p>
<div class="c4">
<p>Some early compilers flagged an error if <code>#</code> was not the first character on the line.</p>
</div>
<p>Spaces or tabs are permitted between the <code>#</code> and <code>else</code>, but not escape characters or other symbols or macros. The preprocessor removes white space and concatenates the <code>#</code> and <code>else</code> together.</p>
<p>If anything follows the <code>#else</code> directive (other than white space) then the program is malformed.</p>
<p>The following are valid uses:</p>
<pre>#else
#   else
# /* comments are white space */ else</pre>
<p>The following are invalid uses:</p>
<pre>// #\ is not a valid preprocessor directive
# \t else
// #" is not a valid preprocessor directive
# "" else
// malformed because only white space may follow #else
#else MY_MACRO</pre>
<h1>Use</h1>
<p>The <code>#else</code> must appear as the last alternative in a preprocessor selection block. If all the preceding selection options fail, then the code contained between the <code>#else</code> and closing <code>#endif</code> is compiled.</p>
<p>The statements following the <code>#else</code> may be language statements or preprocessor statements. There is no limit on the nesting of preprocessor directives or statements.</p>
<pre> #ifdef MY_MACRO
.
.
.
// these statements will only be compiled if MY_MACRO exists
.
.
.
#else
.
.
.
// these statements will only be compiled if MY_MACRO does not exist
.
.
.
#endif</pre>

<p>The post <a href="https://complete-concrete-concise.com/programming/c/preprocessor-the-else-directive/">Preprocessor – the #else Directive</a> appeared first on <a href="https://complete-concrete-concise.com">Complete, Concrete, Concise</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
