<?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/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"	>
<channel>
	<title>Comments on: C conundrum (below)</title>
	<atom:link href="http://tecnocode.co.uk/2007/12/26/c-conundrum-below/feed/" rel="self" type="application/rss+xml" />
	<link>http://tecnocode.co.uk/2007/12/26/c-conundrum-below/</link>
	<description>Ramblings on computers…</description>
	<lastBuildDate>Fri, 20 Jan 2012 21:19:46 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: me</title>
		<link>http://tecnocode.co.uk/2007/12/26/c-conundrum-below/comment-page-1/#comment-97</link>
		<dc:creator>me</dc:creator>
		<pubDate>Thu, 27 Dec 2007 14:14:03 +0000</pubDate>
		<guid isPermaLink="false">http://tecnocode.co.uk/wordpress/?p=67#comment-97</guid>
		<description>If you want to do people a favor, update your blog post with the solution you chose (or post another one)</description>
		<content:encoded><![CDATA[<p>If you want to do people a favor, update your blog post with the solution you chose (or post another one)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joseph</title>
		<link>http://tecnocode.co.uk/2007/12/26/c-conundrum-below/comment-page-1/#comment-96</link>
		<dc:creator>Joseph</dc:creator>
		<pubDate>Thu, 27 Dec 2007 00:27:50 +0000</pubDate>
		<guid isPermaLink="false">http://tecnocode.co.uk/wordpress/?p=67#comment-96</guid>
		<description>http://gcc.gnu.org/onlinedocs/gcc-4.2.2/cpp/Concatenation.html#Concatenation</description>
		<content:encoded><![CDATA[<p><a href="http://gcc.gnu.org/onlinedocs/gcc-4.2.2/cpp/Concatenation.html#Concatenation" rel="nofollow">http://gcc.gnu.org/onlinedocs/gcc-4.2.2/cpp/Concatenation.html#Concatenation</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zack</title>
		<link>http://tecnocode.co.uk/2007/12/26/c-conundrum-below/comment-page-1/#comment-95</link>
		<dc:creator>Zack</dc:creator>
		<pubDate>Wed, 26 Dec 2007 22:19:29 +0000</pubDate>
		<guid isPermaLink="false">http://tecnocode.co.uk/wordpress/?p=67#comment-95</guid>
		<description>I am not sure I understand your example but I believe this is the construct you want:

&lt;code&gt;#define S(x) S_(x)
#define S_(x) #x
...
some_function_which_takes_a_string (&quot;String literal with FOOBAR concatenated: &quot; S(FOOBAR));&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>I am not sure I understand your example but I believe this is the construct you want:</p>
<p><code>#define S(x) S_(x)<br />
#define S_(x) #x<br />
...<br />
some_function_which_takes_a_string ("String literal with FOOBAR concatenated: " S(FOOBAR));</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Philip</title>
		<link>http://tecnocode.co.uk/2007/12/26/c-conundrum-below/comment-page-1/#comment-94</link>
		<dc:creator>Philip</dc:creator>
		<pubDate>Wed, 26 Dec 2007 22:08:53 +0000</pubDate>
		<guid isPermaLink="false">http://tecnocode.co.uk/wordpress/?p=67#comment-94</guid>
		<description>Thanks everyone. Benjamin&#039;s suggestion is the most useful, since what I&#039;m working on uses Glib, but I&#039;m grateful for others&#039; suggestions too. &lt;img src=&quot;http://tecnocode.co.uk/images/emoticons/smile.png&quot; alt=&quot;:)&quot; /&gt;
I feel a bit of an idiot now, as the solution&#039;s so simple. Live and learn.</description>
		<content:encoded><![CDATA[<p>Thanks everyone. Benjamin's suggestion is the most useful, since what I'm working on uses Glib, but I'm grateful for others' suggestions too. <img src="http://tecnocode.co.uk/images/emoticons/smile.png" alt=":)" /><br />
I feel a bit of an idiot now, as the solution's so simple. Live and learn.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ion</title>
		<link>http://tecnocode.co.uk/2007/12/26/c-conundrum-below/comment-page-1/#comment-93</link>
		<dc:creator>ion</dc:creator>
		<pubDate>Wed, 26 Dec 2007 20:54:53 +0000</pubDate>
		<guid isPermaLink="false">http://tecnocode.co.uk/wordpress/?p=67#comment-93</guid>
		<description>Sorry, please ignore my previous comment. I misparsed the question due to my browser not rendering the code with any line feeds.</description>
		<content:encoded><![CDATA[<p>Sorry, please ignore my previous comment. I misparsed the question due to my browser not rendering the code with any line feeds.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ion</title>
		<link>http://tecnocode.co.uk/2007/12/26/c-conundrum-below/comment-page-1/#comment-92</link>
		<dc:creator>ion</dc:creator>
		<pubDate>Wed, 26 Dec 2007 20:50:21 +0000</pubDate>
		<guid isPermaLink="false">http://tecnocode.co.uk/wordpress/?p=67#comment-92</guid>
		<description>&lt;code&gt;#define FOOBAR(n) do { foo (n); bar (&quot;baz: &quot; #n); } while (0)&lt;/code&gt;

&lt;code&gt;FOOBAR (1+2)&lt;/code&gt; will call &lt;code&gt;foo (3)&lt;/code&gt; and &lt;code&gt;bar (&quot;baz: 1+2&quot;)&lt;/code&gt;.</description>
		<content:encoded><![CDATA[<p><code>#define FOOBAR(n) do { foo (n); bar (&quot;baz: &quot; #n); } while (0)</code></p>
<p><code>FOOBAR (1+2)</code> will call <code>foo (3)</code> and <code>bar ("baz: 1+2")</code>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tuXXX</title>
		<link>http://tecnocode.co.uk/2007/12/26/c-conundrum-below/comment-page-1/#comment-91</link>
		<dc:creator>tuXXX</dc:creator>
		<pubDate>Wed, 26 Dec 2007 16:52:41 +0000</pubDate>
		<guid isPermaLink="false">http://tecnocode.co.uk/wordpress/?p=67#comment-91</guid>
		<description>This is described in the gcc C preprocessor documentation ( http://gcc.gnu.org/onlinedocs/cpp/Stringification.html ) :

&lt;code&gt;#define xstr(s) str(s)
#define str(s) #s
#define FOOBAR 5
[...]
some_function_which_takes_an_integer (FOOBAR);
some_function_which_takes_a_string (&quot;String literal with FOOBAR concatenated: &quot; xstr(FOOBAR));&lt;/code&gt;

After preprocessing, this will be :
&lt;code&gt;some_function_which_takes_an_integer (5);
some_function_which_takes_a_string (&quot;String literal with FOOBAR concatenated: &quot; &quot;5&quot;);&lt;/code&gt;

And then the compiler will concatenate the two strings as :
&lt;code&gt;some_function_which_takes_a_string (&quot;String literal with FOOBAR concatenated: 5&quot;);&lt;/code&gt;

Hope it&#039;ll help you &lt;img src=&quot;http://tecnocode.co.uk/images/emoticons/smile.png&quot; alt=&quot;:)&quot; /&gt;</description>
		<content:encoded><![CDATA[<p>This is described in the gcc C preprocessor documentation ( <a href="http://gcc.gnu.org/onlinedocs/cpp/Stringification.html" rel="nofollow">http://gcc.gnu.org/onlinedocs/cpp/Stringification.html</a> ) :</p>
<p><code>#define xstr(s) str(s)<br />
#define str(s) #s<br />
#define FOOBAR 5<br />
[...]<br />
some_function_which_takes_an_integer (FOOBAR);<br />
some_function_which_takes_a_string (&quot;String literal with FOOBAR concatenated: &quot; xstr(FOOBAR));</code></p>
<p>After preprocessing, this will be :<br />
<code>some_function_which_takes_an_integer (5);<br />
some_function_which_takes_a_string (&quot;String literal with FOOBAR concatenated: &quot; &quot;5&quot;);</code></p>
<p>And then the compiler will concatenate the two strings as :<br />
<code>some_function_which_takes_a_string (&quot;String literal with FOOBAR concatenated: 5&quot;);</code></p>
<p>Hope it'll help you <img src="http://tecnocode.co.uk/images/emoticons/smile.png" alt=":)" /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian Vogel</title>
		<link>http://tecnocode.co.uk/2007/12/26/c-conundrum-below/comment-page-1/#comment-90</link>
		<dc:creator>Christian Vogel</dc:creator>
		<pubDate>Wed, 26 Dec 2007 16:45:43 +0000</pubDate>
		<guid isPermaLink="false">http://tecnocode.co.uk/wordpress/?p=67#comment-90</guid>
		<description>have a look at the bottom of http://gcc.gnu.org/onlinedocs/cpp/Stringification.html</description>
		<content:encoded><![CDATA[<p>have a look at the bottom of <a href="http://gcc.gnu.org/onlinedocs/cpp/Stringification.html" rel="nofollow">http://gcc.gnu.org/onlinedocs/cpp/Stringification.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Benjamin Otte</title>
		<link>http://tecnocode.co.uk/2007/12/26/c-conundrum-below/comment-page-1/#comment-89</link>
		<dc:creator>Benjamin Otte</dc:creator>
		<pubDate>Wed, 26 Dec 2007 16:36:20 +0000</pubDate>
		<guid isPermaLink="false">http://tecnocode.co.uk/wordpress/?p=67#comment-89</guid>
		<description>&lt;tt&gt;G_STRINGIFY&lt;/tt&gt; does exactly that for me</description>
		<content:encoded><![CDATA[<p><tt>G_STRINGIFY</tt> does exactly that for me</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Noname</title>
		<link>http://tecnocode.co.uk/2007/12/26/c-conundrum-below/comment-page-1/#comment-88</link>
		<dc:creator>Noname</dc:creator>
		<pubDate>Wed, 26 Dec 2007 16:36:02 +0000</pubDate>
		<guid isPermaLink="false">http://tecnocode.co.uk/wordpress/?p=67#comment-88</guid>
		<description>Try the following:
&lt;code&gt;#define FOOBAR 5
#define STRINGIFY(x) #x
#define STRINGIFYVALUE(x) STRINGIFY(x)
some_function_which_takes_a_string (&quot;String literal with FOOBAR concatenated: &quot;STRINGIFY(FOOBAR));
some_function_which_takes_a_string (&quot;String literal with FOOBAR concatenated: &quot;STRINGIFYVALUE(FOOBAR));&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Try the following:<br />
<code>#define FOOBAR 5<br />
#define STRINGIFY(x) #x<br />
#define STRINGIFYVALUE(x) STRINGIFY(x)<br />
some_function_which_takes_a_string (&quot;String literal with FOOBAR concatenated: &quot;STRINGIFY(FOOBAR));<br />
some_function_which_takes_a_string (&quot;String literal with FOOBAR concatenated: &quot;STRINGIFYVALUE(FOOBAR));</code></p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.306 seconds -->

