<?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>Codec &#187; primer</title>
	<atom:link href="http://www.trembl.org/codec/tag/primer/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.trembl.org/codec</link>
	<description>A Personal Polylogic Code/Decode &#039;Zettelkasten&#039;</description>
	<lastBuildDate>Thu, 02 Feb 2012 03:38:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Swimming Nearly drowning in C++</title>
		<link>http://www.trembl.org/codec/313/</link>
		<comments>http://www.trembl.org/codec/313/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 09:18:19 +0000</pubDate>
		<dc:creator>Georg Tremmel</dc:creator>
				<category><![CDATA[Raw]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[introdcution]]></category>
		<category><![CDATA[primer]]></category>

		<guid isPermaLink="false">http://www.trembl.org/codec/?p=313</guid>
		<description><![CDATA[OK, I&#8217;ve decided to do it. To leave the elegance of Objective-C and have a closer look at C++. After all, isn&#8217;t everyone doing oF these days? Here a recapitulation of usesful C and some quick notes on C++ peculiarities &#8211; sorry &#8211; features: (That might be a good place to start.) Initialisation int a [...]]]></description>
			<content:encoded><![CDATA[<p>OK, I&#8217;ve decided to do it. To leave the elegance of Objective-C and have a closer look at C++. After all, isn&#8217;t everyone doing <a href="http://www.openframeworks.cc">oF</a> these days?</p>
<p>Here a recapitulation of usesful C and some quick notes on C++ peculiarities &#8211;  sorry &#8211; features: (<a href="http://www.cplusplus.com/doc/tutorial/">That</a> might be a good place to start.)</p>
<p><strong>Initialisation</strong><br />
int a = 1; 		// standard c way<br />
int b(1);			// same</p>
<p><strong>Defined constant</strong>s<br />
#define PI 3.1415927		// faster than var</p>
<p><strong>Declared constants</strong><br />
const int c = 100		// immutable</p>
<p>Assignment<br />
= can also be used as rvalue<br />
a = 1 + (b = 2); </p>
<p>same as:<br />
b = 2;<br />
a = 1 + b;</p>
<p><strong>Comma operator</strong><br />
a = (b=3, b+2);		// a = 5</p>
<blockquote><p>When the set of expressions has to be evaluated for a value, only the rightmost expression is considered</p></blockquote>
<p><strong>Type casting</strong><br />
int i, j;<br />
float f = 1.234;<br />
i = (int) f;<br />
j = int (f);</p>
<p><strong>sizeof()</strong><br />
One parameter, either a type or a variable and returns the size in bytes.</p>
<p>a = sizeof (char);</p>
<p>Will become important with arrays.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.trembl.org/codec/313/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

