<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: A little-known trick with C switches</title>
	<atom:link href="http://blog.linuxgamepublishing.com/2009/03/03/a-little-known-trick-with-c-switches/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.linuxgamepublishing.com/2009/03/03/a-little-known-trick-with-c-switches/</link>
	<description>Commercial gaming for Linux</description>
	<lastBuildDate>Fri, 09 Nov 2012 18:53:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Torbjörn Andersson</title>
		<link>http://blog.linuxgamepublishing.com/2009/03/03/a-little-known-trick-with-c-switches/comment-page-1/#comment-113</link>
		<dc:creator>Torbjörn Andersson</dc:creator>
		<pubDate>Sat, 07 Mar 2009 19:20:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.linuxgamepublishing.com/?p=102#comment-113</guid>
		<description>Probably not. At least, I&#039;ve never seen it in any book on standard C. Of course, there could be other compilers that also implement it as an extension.

Of course, you can still do some pretty strange things with switch in standard C. My favorite example (in the &quot;I&#039;m never, ever, EVER going to use that!&quot; sense) is probably Duff&#039;s Device: http://en.wikipedia.org/wiki/Duff%27s_device</description>
		<content:encoded><![CDATA[<p>Probably not. At least, I&#8217;ve never seen it in any book on standard C. Of course, there could be other compilers that also implement it as an extension.</p>
<p>Of course, you can still do some pretty strange things with switch in standard C. My favorite example (in the &#8220;I&#8217;m never, ever, EVER going to use that!&#8221; sense) is probably Duff&#8217;s Device: <a href="http://en.wikipedia.org/wiki/Duff%27s_device" rel="nofollow">http://en.wikipedia.org/wiki/Duff%27s_device</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ahmed Ibrahim</title>
		<link>http://blog.linuxgamepublishing.com/2009/03/03/a-little-known-trick-with-c-switches/comment-page-1/#comment-111</link>
		<dc:creator>Ahmed Ibrahim</dc:creator>
		<pubDate>Sat, 07 Mar 2009 15:08:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.linuxgamepublishing.com/?p=102#comment-111</guid>
		<description>Do you mean that if i used it in a non-using GCC compiler, it won&#039;t work?</description>
		<content:encoded><![CDATA[<p>Do you mean that if i used it in a non-using GCC compiler, it won&#8217;t work?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Craig</title>
		<link>http://blog.linuxgamepublishing.com/2009/03/03/a-little-known-trick-with-c-switches/comment-page-1/#comment-109</link>
		<dc:creator>Jeff Craig</dc:creator>
		<pubDate>Fri, 06 Mar 2009 20:15:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.linuxgamepublishing.com/?p=102#comment-109</guid>
		<description>Ah, so this is a GCC extension. A co-worker and I were absolutely amazed that we&#039;d never heard of this before.</description>
		<content:encoded><![CDATA[<p>Ah, so this is a GCC extension. A co-worker and I were absolutely amazed that we&#8217;d never heard of this before.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Torbjörn Andersson</title>
		<link>http://blog.linuxgamepublishing.com/2009/03/03/a-little-known-trick-with-c-switches/comment-page-1/#comment-102</link>
		<dc:creator>Torbjörn Andersson</dc:creator>
		<pubDate>Fri, 06 Mar 2009 10:12:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.linuxgamepublishing.com/?p=102#comment-102</guid>
		<description>It&#039;s one of many GCC extensions to the C/C++ languages. It&#039;s been there for a long time:

http://gcc.gnu.org/onlinedocs/gcc-4.3.3/gcc/C-Extensions.html#C-Extensions</description>
		<content:encoded><![CDATA[<p>It&#8217;s one of many GCC extensions to the C/C++ languages. It&#8217;s been there for a long time:</p>
<p><a href="http://gcc.gnu.org/onlinedocs/gcc-4.3.3/gcc/C-Extensions.html#C-Extensions" rel="nofollow">http://gcc.gnu.org/onlinedocs/gcc-4.3.3/gcc/C-Extensions.html#C-Extensions</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ahmed Ibrahim</title>
		<link>http://blog.linuxgamepublishing.com/2009/03/03/a-little-known-trick-with-c-switches/comment-page-1/#comment-101</link>
		<dc:creator>Ahmed Ibrahim</dc:creator>
		<pubDate>Thu, 05 Mar 2009 20:35:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.linuxgamepublishing.com/?p=102#comment-101</guid>
		<description>WOW! I didnt know that i can do this in a switch statement .</description>
		<content:encoded><![CDATA[<p>WOW! I didnt know that i can do this in a switch statement .</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Clive Crous</title>
		<link>http://blog.linuxgamepublishing.com/2009/03/03/a-little-known-trick-with-c-switches/comment-page-1/#comment-100</link>
		<dc:creator>Clive Crous</dc:creator>
		<pubDate>Wed, 04 Mar 2009 07:59:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.linuxgamepublishing.com/?p=102#comment-100</guid>
		<description>Ruby also allows this eg:

case number
  when 1..4
    do_something
  when 5..10
    do_something_else
  when /[A-Za-z ]+/
    do_something_alphabetic
  else
    do_something_defalt
end</description>
		<content:encoded><![CDATA[<p>Ruby also allows this eg:</p>
<p>case number<br />
  when 1..4<br />
    do_something<br />
  when 5..10<br />
    do_something_else<br />
  when /[A-Za-z ]+/<br />
    do_something_alphabetic<br />
  else<br />
    do_something_defalt<br />
end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: blindcoder</title>
		<link>http://blog.linuxgamepublishing.com/2009/03/03/a-little-known-trick-with-c-switches/comment-page-1/#comment-97</link>
		<dc:creator>blindcoder</dc:creator>
		<pubDate>Tue, 03 Mar 2009 10:46:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.linuxgamepublishing.com/?p=102#comment-97</guid>
		<description>That&#039;s actually nice to know. Makes for easier-to-read code.

My personal favorite switch statement is Perl, though:

for ($variable){
        if (/^abc$/){
                do_something();
        } elsif (/^[0-9]+$/){
                do_something_else();
        } else {
                throw_an_error();
        }
}</description>
		<content:encoded><![CDATA[<p>That&#8217;s actually nice to know. Makes for easier-to-read code.</p>
<p>My personal favorite switch statement is Perl, though:</p>
<p>for ($variable){<br />
        if (/^abc$/){<br />
                do_something();<br />
        } elsif (/^[0-9]+$/){<br />
                do_something_else();<br />
        } else {<br />
                throw_an_error();<br />
        }<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>
