<?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>Said Svec &#187; geek</title>
	<atom:link href="http://www.saidsvec.com/category/geek/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.saidsvec.com</link>
	<description>Firmware and Software and Hardware, oh my!</description>
	<lastBuildDate>Fri, 23 Dec 2011 23:48:31 +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>Creation, Ownership, Drive, and Motivation</title>
		<link>http://www.saidsvec.com/2010/08/22/creation-ownership-drive-motivation/</link>
		<comments>http://www.saidsvec.com/2010/08/22/creation-ownership-drive-motivation/#comments</comments>
		<pubDate>Sun, 22 Aug 2010 21:16:57 +0000</pubDate>
		<dc:creator>svec</dc:creator>
				<category><![CDATA[geek]]></category>
		<category><![CDATA[Management]]></category>

		<guid isPermaLink="false">http://www.saidsvec.com/?p=294</guid>
		<description><![CDATA[Ben Pieratt says: &#8220;Creation is entirely dependent on ownership. Ownership not as a percentage of equity, but as a measure of your ability to change things for the better. To build and grow and fail and learn. This is no small thing. Creativity is the manifestation of lateral thinking, and without tangible results, it becomes [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Ben Pieratt's blog" href="http://pieratt.tumblr.com/">Ben Pieratt</a> says:</p>
<blockquote><p>&#8220;Creation is entirely dependent on ownership.</p>
<p>Ownership not as a percentage of equity, but as a measure of your  ability to change things for the better. To build and grow and fail and  learn. This is no small thing. Creativity is the manifestation of  lateral thinking, and without tangible results, it becomes stunted. We  have to see the fruits of our labors, good or bad, or there’s no  motivation to proceed, nothing to learn from to inform the next  decision. States of approval and decisions-by-committee and constant  compromises are third-party interruptions of an internal dialog that  needs to come to its own conclusions.&#8221;</p></blockquote>
<p>Check out Ben&#8217;s full post: <a title="In Praise of Quitting Your Job" href="http://pieratt.tumblr.com/post/977179815/in-praise-of-quitting-your-job">http://pieratt.tumblr.com/post/977179815/in-praise-of-quitting-your-job</a></p>
<p>Don&#8217;t let the title of &#8220;In Praise of Quitting Your Job&#8221; fool you into thinking it&#8217;s a negative post &#8211; it&#8217;s not.  It&#8217;s a positive post, which lines up well with <a title="Daniel Pink's blog" href="http://www.danpink.com/">Daniel Pink&#8217;s</a> book, &#8220;<a href="http://www.amazon.com/gp/product/1594488843?ie=UTF8&amp;tag=saisve-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1594488843">Drive: The Surprising Truth About What Motivates Us</a><img style="border: none !important; margin: 0px !important;" src="http://www.assoc-amazon.com/e/ir?t=saisve-20&amp;l=as2&amp;o=1&amp;a=1594488843" border="0" alt="" width="1" height="1" />.&#8221;  <em> </em></p>
<p><em>Drive</em> looks at &#8220;the three elements of true motivation—autonomy, mastery, and purpose,&#8221; which is another way of talking about what Ben calls &#8220;ownership.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.saidsvec.com/2010/08/22/creation-ownership-drive-motivation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I love embedded, and so does Woz!</title>
		<link>http://www.saidsvec.com/2010/07/05/i-love-embedded-and-so-does-woz/</link>
		<comments>http://www.saidsvec.com/2010/07/05/i-love-embedded-and-so-does-woz/#comments</comments>
		<pubDate>Mon, 05 Jul 2010 23:44:20 +0000</pubDate>
		<dc:creator>svec</dc:creator>
				<category><![CDATA[embedded]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[woz]]></category>

		<guid isPermaLink="false">http://www.saidsvec.com/?p=273</guid>
		<description><![CDATA[I love working in the embedded world.  Hardware + software = a great time and a great career. I came across this fantastic quote by Steve Wozniak in &#8220;Making it Big in Software,&#8221; by Sam Lightstone.  Woz is talking about designing the Apple II: &#8220;And I did every piece of software from the ground up, [...]]]></description>
			<content:encoded><![CDATA[<p>I love working in the embedded world.  Hardware + software = a great time and a great career.</p>
<p>I came across this fantastic quote by Steve Wozniak in &#8220;Making it Big in Software,&#8221; by Sam Lightstone.  Woz is talking about designing the Apple II:</p>
<blockquote><p>&#8220;And I did every piece of software from the ground up, through applications that you can&#8217;t pin down for any one of them.  The hardware was so interrelated that I can&#8217;t really divide it into software and hardware alone.  Those days were that way.  <strong>Today, if you work on embedded processors, you put a little microprocessor into a small product.  That&#8217;s the job in the world that I would love to this day!</strong> That&#8217;s what I did back then; it mixed both hardware and software.&#8221;</p></blockquote>
<p>Sounds like Woz wants my job.  :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.saidsvec.com/2010/07/05/i-love-embedded-and-so-does-woz/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Geeky Grammar</title>
		<link>http://www.saidsvec.com/2009/02/10/geeky-grammar/</link>
		<comments>http://www.saidsvec.com/2009/02/10/geeky-grammar/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 07:02:08 +0000</pubDate>
		<dc:creator>svec</dc:creator>
				<category><![CDATA[copyediting]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[emoticons]]></category>
		<category><![CDATA[grammar]]></category>
		<category><![CDATA[xkcd]]></category>

		<guid isPermaLink="false">http://svec.wordpress.com/?p=159</guid>
		<description><![CDATA[Holy Parenthetical Emoticons, Batman! I&#8217;m glad that Randall has the guts to tackle the tough issues facing the world today: emoticons in parenthesis. Check out the comic. Since I&#8217;m starting my own copyediting and proofreading business, this issue is particularly timely and relevant for me. Randall outlines the basic options: blah (or blah :) blah (or [...]]]></description>
			<content:encoded><![CDATA[<h2>Holy Parenthetical Emoticons, Batman!</h2>
<p>I&#8217;m glad that Randall has the guts to tackle the tough issues facing the world today: emoticons in parenthesis. <a title="xkcd comic about emoticons in parenthesis" href="http://xkcd.com/541/">Check out the comic.</a></p>
<p>Since I&#8217;m starting my own copyediting and proofreading business, this issue is particularly timely and relevant for me.</p>
<p>Randall outlines the basic options:</p>
<ul>
<li>blah (or blah :)</li>
<li>blah (or blah :) )</li>
</ul>
<p>The first option looks like the author threw an extra colon in there.  The second option looks like the author mashed the keyboard with her elbow.</p>
<p>We also need to consider these options:</p>
<ul>
<li>blah (or blah :-)</li>
<li>blah (or blah :-) )</li>
<li>blah (or blah :-D)</li>
<li>blah (or blah :-D )</li>
<li>blah (or blah :-)-)</li>
<li>and what about (this (or this (it gets ridiculous fast :) ) )</li>
</ul>
<p>&#8220;American&#8221; English writing style is primarily dictated by two style guides: <em>The Chicago Manual of Style (CMOS)</em> and <em>The AP Stylebook</em>.</p>
<p>I could only find references to emoticons and parenthesis in <em>CMOS</em>, and it dodges the question (<a title="CMOS on Emoticons and Parenthesis" href="http://www.chicagomanualofstyle.org/CMS_FAQ/InternetWebandOtherPost-WatergateConcerns/InternetWebandOtherPost-WatergateConcerns05.html">source</a>):</p>
<blockquote><p>Until academic standards decline enough to accommodate the use of emoticons, I’m afraid <em>CMOS</em> is unlikely to treat their styling, since the manual is aimed primarily at scholarly publications. And the problems you’ve    posed in this note give us added incentive to keep our distance.</p></blockquote>
<p>If the experts are no help, what are we to do?</p>
<p>Thankfully the web makes everyone a Certified Internet Expert (including me :) ), so follow along as I puzzle it out.</p>
<h2>Round One</h2>
<ul>
<li>As a programmer I want each open parenthesis &#8220;(&#8221; to match exactly one close parenthesis &#8220;)&#8221;.</li>
<li>As a writer I realize that an emoticon must be considered as a whole, not merely as a collection of individual characters.  Therefore any parenthesis or other character within an emoticon should have no bearing on the punctuation of other words.</li>
</ul>
<h2>Round Two</h2>
<ul>
<li>As a programmer I know that I will try to visually match each parenthesis pair I see.</li>
<li>As a writer I find &#8220;) )&#8221; slightly less offensive than &#8220;))&#8221;.</li>
</ul>
<h2>Round Three</h2>
<ul>
<li>As a programmer I will use sed or vim or a Firefox hack to rewrite any text I don&#8217;t like, so I don&#8217;t really care what you writers think.</li>
<li>As a writer I want the rules that govern &#8220;:)&#8221; to match the rules that govern &#8220;:D&#8221;.</li>
</ul>
<h2>The Decision</h2>
<p>As a Certified Internet Expert I decree that emoticons shall be considered as a single symbol.  An emoticon shall always be followed by a space.  If an emoticon ends a parenthetical phrase, the closing parenthesis that matches the opening parenthesis must be used, regardless of whether the emoticon itself contains a parenthesis.</p>
<h3>Correct examples:</h3>
<ul>
<li>He said he would be happy to do it (he lied :) ).</li>
<li>He lied (she knew he would :D ).</li>
</ul>
<p>Tune in next time for another exciting episode of geeky grammar.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.saidsvec.com/2009/02/10/geeky-grammar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>M&amp;M&#8217;s Musings</title>
		<link>http://www.saidsvec.com/2009/01/21/mm-musings/</link>
		<comments>http://www.saidsvec.com/2009/01/21/mm-musings/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 04:13:57 +0000</pubDate>
		<dc:creator>svec</dc:creator>
				<category><![CDATA[amd]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[candy]]></category>
		<category><![CDATA[M&M's]]></category>
		<category><![CDATA[useless]]></category>

		<guid isPermaLink="false">http://svec.wordpress.com/?p=141</guid>
		<description><![CDATA[We have an M&#38;M&#8217;s-filled candy machine at work and we wondered: What do you call it when you get exactly 6 M&#38;M&#8217;s in a single turn of the dispenser, one of each color?  M&#38;M Yahtzee?  Full House? And how about when you get more than 6 M&#38;M&#8217;s in a single turn of the dispenser, with [...]]]></description>
			<content:encoded><![CDATA[<p>We have an M&amp;M&#8217;s-filled candy machine at work and we wondered:</p>
<ul>
<li>What do you call it when you get exactly 6 M&amp;M&#8217;s in a single turn of the dispenser, one of each color?  M&amp;M Yahtzee?  Full House?</li>
<li>And how about when you get more than 6 M&amp;M&#8217;s in a single turn of the dispenser, with at least one of each color?</li>
</ul>
<p>Suggestions?  Please leave a comment!</p>
<p>PS: the 6 M&amp;M&#8217;s colors are red, orange, yellow, green, blue and brown.  <a title="Peanut M&amp;M's product page." href="http://www.m-ms.com/us/about/products/peanutmms/">See for yourself.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.saidsvec.com/2009/01/21/mm-musings/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Presentation Presence</title>
		<link>http://www.saidsvec.com/2008/12/17/presentation-presence/</link>
		<comments>http://www.saidsvec.com/2008/12/17/presentation-presence/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 05:08:19 +0000</pubDate>
		<dc:creator>svec</dc:creator>
				<category><![CDATA[business]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[marketing]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[sales]]></category>
		<category><![CDATA[sales pitch]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://svec.wordpress.com/?p=54</guid>
		<description><![CDATA[A software vendor gave a sales presentation at my office today. The vendor sent two people to present &#8211; a sales guy and an engineer. The sales guy started the pitch with an overview of the software. Sounds great, says us, but we need a bunch of technical details to know if it&#8217;s worth pursuing. [...]]]></description>
			<content:encoded><![CDATA[<p>A software vendor gave a sales presentation at my office today.</p>
<p>The vendor sent two people to present &#8211; a sales guy and an engineer.</p>
<p>The sales guy started the pitch with an overview of the software.  Sounds great, says us, but we need a bunch of technical details to know if it&#8217;s worth pursuing.  This is a critical piece of software, it will interact with a lot of internal systems, and so we need to know what we&#8217;re getting ourselves into.</p>
<p>So we ask a bunch of questions which the engineer answers to our satisfaction.  Probably 30 or 45 minutes go by, mostly a back-and-forth between us and the engineer. He knows his stuff, and he seems to enjoy telling us about their technology.</p>
<p>The sales guy doesn&#8217;t have much to contribute, which is fine.  Or rather, it would have been fine, if Mr. Salesguy would have appeared to be paying attention, or at least not acting distracted and bored.</p>
<p>Instead Mr. Salesguy checks his email.  Checks his voicemail.  Fiddles with his pen.  Fools around on his computer for a while.  Does a lot of things that tell me he doesn&#8217;t care about this sale.  All with a look of &#8220;Get me out of here&#8221; on his face.  Which doesn&#8217;t exactly inspire confidence or help the sale at all.</p>
<p>What&#8217;s the lesson here?  When you make a sales pitch / presentation / demo / whatever, make sure that every single member of your team is devoting 100% of their attention to the customer.  Even if you&#8217;re not currently speaking, even if you&#8217;ll never speak &#8211; act interested!  Better yet, BE interested!  And if you can&#8217;t get interested, then you probably don&#8217;t need to be there in the first place.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.saidsvec.com/2008/12/17/presentation-presence/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I agree</title>
		<link>http://www.saidsvec.com/2008/07/12/i-agree/</link>
		<comments>http://www.saidsvec.com/2008/07/12/i-agree/#comments</comments>
		<pubDate>Sat, 12 Jul 2008 05:12:00 +0000</pubDate>
		<dc:creator>svec</dc:creator>
				<category><![CDATA[geek]]></category>
		<category><![CDATA[xkcd]]></category>

		<guid isPermaLink="false">http://svec.wordpress.com/?p=66</guid>
		<description><![CDATA[http://xkcd.com/319/ I love xkcd.]]></description>
			<content:encoded><![CDATA[<p><a title="Clearly the coyote didn't want it enough." href="http://xkcd.com/319/">http://xkcd.com/319/</a></p>
<p>I love xkcd.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.saidsvec.com/2008/07/12/i-agree/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Death Of the Desktop</title>
		<link>http://www.saidsvec.com/2008/06/17/the-death-of-the-desktop/</link>
		<comments>http://www.saidsvec.com/2008/06/17/the-death-of-the-desktop/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 04:19:49 +0000</pubDate>
		<dc:creator>svec</dc:creator>
				<category><![CDATA[geek]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[aza raskin]]></category>
		<category><![CDATA[enso]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://svec.wordpress.com/?p=63</guid>
		<description><![CDATA[And no, this &#8220;death of the desktop&#8221; post is not about how mobile devices or the browser is taking over the world &#8211; it&#8217;s about taking a step back and rethinking how we actually use computers (desktop, mobile or otherwise), and then trying to take a more usable step forward. Thanks to Chris Jones for [...]]]></description>
			<content:encoded><![CDATA[<p>And no, this &#8220;death of the desktop&#8221; post is not about how mobile devices or the browser is taking over the world &#8211; it&#8217;s about taking a step back and rethinking how we actually use computers (desktop, mobile or otherwise), and then trying to take a more usable step forward.</p>
<p>Thanks to <a href="http://www.jonezy.org/blog/2008/06/16/why-cant-i-do-that/">Chris Jones for writing</a> about a very interesting talk by <a href="http://en.wikipedia.org/wiki/Aza_Raskin" target="_blank">Aza Raskin</a>:</p>
<p><a title="http://video.google.com/videoplay?docid=-6856727143023456694" href="http://video.google.com/videoplay?docid=-6856727143023456694"><span>Video: Away with Applications: The Death of the Desktop</span></a></p>
<p>You should check out Chris&#8217;s summary, and the video as well.</p>
<p>This is one of the few videos I&#8217;m glad I watched instead of just ripped to mp3 and listened to &#8211; a lot of visual stuff, well worth the time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.saidsvec.com/2008/06/17/the-death-of-the-desktop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why bother with RSS?</title>
		<link>http://www.saidsvec.com/2008/03/30/why-bother-with-rss/</link>
		<comments>http://www.saidsvec.com/2008/03/30/why-bother-with-rss/#comments</comments>
		<pubDate>Sun, 30 Mar 2008 16:45:02 +0000</pubDate>
		<dc:creator>svec</dc:creator>
				<category><![CDATA[blogging]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[blogs]]></category>
		<category><![CDATA[feeds]]></category>
		<category><![CDATA[newsgator]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[rss readers]]></category>

		<guid isPermaLink="false">http://svec.wordpress.com/?p=55</guid>
		<description><![CDATA[(cut-n-pasted from my reply to a &#8220;Business of Software&#8221; forum question) I resisted using an RSS reader for quite a while, mainly because it was &#8220;the new hotness&#8221; that I didn&#8217;t see any use for. What made me start using it? I read a fair number of websites, and I like to know when something [...]]]></description>
			<content:encoded><![CDATA[<p>(cut-n-pasted from my reply to a &#8220;Business of Software&#8221; forum question)</p>
<p>I resisted using an RSS reader for quite a while, mainly because it was &#8220;the new hotness&#8221; that I didn&#8217;t see any use for.</p>
<p>What made me start using it?</p>
<p>I read a fair number of websites, and I like to know when something new shows up.  So I used to check each website every day and scan it for new content.  Slashdot.  Anything new?  Yup, read a couple.  Joel on Software.  Anything new?  No.  Paul Graham&#8217;s rants.  Anything new?  No.  Steve Yegge.  Anything new?  Yes, read it.  You get the point.</p>
<p>The &#8220;load page &#8211; see if anything new&#8221; loop was getting tedious, especially since frequently there was nothing new to read, so loading the page was a waste of time.</p>
<p>Enter RSS.  I chose NewsGator Online, subscribed to the websites/blogs I like, and *bam* &#8211; all the new content comes right to me, only one website (NewsGator) to load, no wasted time.</p>
<p>Well, unless you count the time I spend reading stuff on the web as wasted time, which might be accurate.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.saidsvec.com/2008/03/30/why-bother-with-rss/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Funky Watches</title>
		<link>http://www.saidsvec.com/2008/02/29/funky-watches/</link>
		<comments>http://www.saidsvec.com/2008/02/29/funky-watches/#comments</comments>
		<pubDate>Sat, 01 Mar 2008 00:12:43 +0000</pubDate>
		<dc:creator>svec</dc:creator>
				<category><![CDATA[geek]]></category>
		<category><![CDATA[led watch]]></category>
		<category><![CDATA[watch]]></category>

		<guid isPermaLink="false">http://svec.wordpress.com/2008/02/29/funky-watches/</guid>
		<description><![CDATA[Watches designed for hard core geeks: http://www.tokyoflash.com/en/watches/1/]]></description>
			<content:encoded><![CDATA[<p>Watches designed for hard core geeks:</p>
<p><a href="http://www.tokyoflash.com/en/watches/1/" title="Extremely funky watches.">http://www.tokyoflash.com/en/watches/1/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.saidsvec.com/2008/02/29/funky-watches/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Understanding C pointers: Part 1</title>
		<link>http://www.saidsvec.com/2008/01/01/understanding-c-pointers-part-1/</link>
		<comments>http://www.saidsvec.com/2008/01/01/understanding-c-pointers-part-1/#comments</comments>
		<pubDate>Tue, 01 Jan 2008 17:17:19 +0000</pubDate>
		<dc:creator>svec</dc:creator>
				<category><![CDATA[geek]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[pointers]]></category>

		<guid isPermaLink="false">http://svec.wordpress.com/2007/12/27/understanding-c-pointers-part-1/</guid>
		<description><![CDATA[As I said in &#8220;Understanding C pointers: Part 0,&#8221; I&#8217;m going to try to explain how C pointers work. Let&#8217;s start with the basics. Here&#8217;s some simple C code: int x = 23; int y = x; You can think of each variable as a box which holds the value of that variable. So in [...]]]></description>
			<content:encoded><![CDATA[<p>As I said in &#8220;<a href="http://svec.wordpress.com/2007/12/28/understanding-c-pointers-part-0/" title="Part 0">Understanding C pointers: Part 0</a>,&#8221; I&#8217;m going to try to explain how C pointers work.</p>
<p></p>
<p>Let&#8217;s start with the basics.  Here&#8217;s some simple C code:</p>
<pre>
  int x = 23;
  int y = x;
</pre>
<p>
<br />
You can think of each variable as a box which holds the value of that variable.  So in this example we have 2 boxes, named &#8220;x&#8221; and &#8220;y&#8221;.  After these two statements execute the &#8220;x&#8221; box contains 23, and the &#8220;y&#8221; box also contains 23.  The picture looks like this:<br />
<img src="http://svec.files.wordpress.com/2007/12/ex1_1.png" alt="Example 1-1" /></p>
<p>Pretty straightforward stuff.   If we add this code:</p>
<pre>  x = 17;</pre>
<p>
<br />
the pictures changes to look like this:<br />
<img src="http://svec.files.wordpress.com/2007/12/ex1_2.png" alt="Example 1-2" /></p>
<p>Nothing too fancy there.</p>
<p>Next example: let&#8217;s add a pointer into the mix.</p>
<pre>
  int x = 23;
  int y = x;
  int * p = &amp; x;</pre>
<p>
<br />
If the * or &amp; in the above code scare you, please take a deep breath and relax.  We&#8217;ll get through this, I promise.  :-)</p>
<p>&#8220;x&#8221; is a variable of type integer.  So is &#8220;y&#8221;.  The &#8220;int *&#8221; before p means that p is a variable of type &#8220;pointer to integer&#8221; otherwise known as an &#8220;integer pointer.&#8221;  Nothing magical there.  The &#8220;&amp;&#8221; before &#8220;x&#8221; can be read as the &#8220;address of x,&#8221; or &#8220;the box named x.&#8221;  Which means the pointer &#8220;p&#8221; points to the box named &#8220;x&#8221;.</p>
<p>As in the previous examples we have a box named &#8220;x&#8221; and another box named &#8220;y&#8221;.  This example adds a pointer to an integer called &#8220;p&#8221;.  You can think of this pointer as simply another box, named &#8220;p&#8221;.  The value in the &#8220;p&#8221; box is a pointer to another box.  For the boxes &#8220;x&#8221; and &#8220;y&#8221; we can say things like &#8220;x holds the number 23,&#8221; but for the box &#8220;p&#8221; we say &#8220;p holds a pointer to the box named &#8220;x&#8221;".</p>
<p>A picture is worth at least a few words:</p>
<p><img src="http://svec.files.wordpress.com/2007/12/ex1_3.png" alt="Example 1-3" /><br />
Watch what happens when we add this next line to the example:</p>
<pre>  *p = 17;</pre>
<p>
<br />
The * before the &#8220;p&#8221; tells us we&#8217;re changing the value of what &#8220;p&#8221; points to.  We are <b>not</b> changing the value of &#8220;p&#8221; itself.  The number 17 gets put wherever the value of the &#8220;p&#8221; box point to &#8211; which is the &#8220;x&#8221; box in this case.  After this code runs our picture looks like this:</p>
<p><img src="http://svec.files.wordpress.com/2007/12/ex1_4.png" alt="Example 1-4" /></p>
<p>Notice that &#8220;p&#8221; has not changed.  &#8220;p&#8221; still points to box &#8220;x&#8221;. Only the value in the box that &#8220;p&#8221; was pointing to changed.<b> </b></p>
<p>Let&#8217;s add a couple more lines to that example:</p>
<pre>
   p = &amp; y;
  *p = 42;</pre>
<p>
<br />
The first line changes the value in the box &#8220;p&#8221; to be a pointer to the box &#8220;y&#8221;.  The 2nd line changes the value in the box that &#8220;p&#8221; points to be 42.  The result looks like this:</p>
<p><img src="http://svec.files.wordpress.com/2007/12/ex1_5.png" alt="Example 1-5" /></p>
<p>Drawing these pictures may seem unnecessary, but I guarantee that drawing them will help you understand your code.  Even if you understand pointers completely, when faced with a pointer-laden interview question it&#8217;s a good idea to draw your data structures and pointers.  This way the interviewer can see how you&#8217;re thinking about the question, which is frequently more useful than simply getting the &#8220;right&#8221; answer.</p>
<p>Okay, that&#8217;s the basics.  See &#8211; pointers aren&#8217;t that bad.</p>
<p>And it turns out that the way a computer actually implements variables/pointers is a lot like our simple &#8220;boxes&#8221; model.  Tune in next time for more about that.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.saidsvec.com/2008/01/01/understanding-c-pointers-part-1/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

