<story><title>C for Python programmers (2011)</title><url>http://www.toves.org/books/cpy/</url></story><parent_chain><item><author>protomikron</author><text>IMHO pointers are mostly hard at the beginning because the asterisk-operator is overloaded: On one hand it declares (and optionally initializes) a pointer (type * x = ...;) and on the other it dereferences it (type y = * x;). At least for me that was the thing that puzzled me the most. I would prefer something like that:&lt;p&gt;&lt;pre&gt;&lt;code&gt;  &amp;#x2F;&amp;#x2F; declare and initialize x
  @uint32_t x = 42;

  &amp;#x2F;&amp;#x2F; dereference x
  uint32_t y = ~x;
&lt;/code&gt;&lt;/pre&gt;
I.e. have different symbols for the type and the dereferencer (&amp;#x27;@&amp;#x27; and &amp;#x27;~&amp;#x27; as an example).&lt;p&gt;&amp;#x2F;&amp;#x2F;edit: thanks for the help, fixed snippets - HN&amp;#x27;s parser does not get pointers either apparently :)</text></item><item><author>krat0sprakhar</author><text>I&amp;#x27;ve been programming in Python for a long time and recently took up an OS class which exclusively used C. Syntactic differences aside (declarations in C can get pretty hairy), the steepest learning curve while writing anything useful in C is with a) pointers and b) memory management which this guide doesn&amp;#x27;t seem to cover.&lt;p&gt;From my experience, the best way for learning C has been [0] Build Your Own Lisp and Zed Shaw&amp;#x27;s [1] Learn C The Hard Way.&lt;p&gt;That and of course spending countless hours debugging segfaults and memory leaks.&lt;p&gt;[0] - &lt;a href=&quot;http:&amp;#x2F;&amp;#x2F;www.buildyourownlisp.com&amp;#x2F;&quot; rel=&quot;nofollow&quot;&gt;http:&amp;#x2F;&amp;#x2F;www.buildyourownlisp.com&amp;#x2F;&lt;/a&gt;&lt;p&gt;[1] - &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;learncodethehardway.org&amp;#x2F;c&amp;#x2F;&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;learncodethehardway.org&amp;#x2F;c&amp;#x2F;&lt;/a&gt;</text></item></parent_chain><comment><author>roel_v</author><text>I&amp;#x27;ve been programming C++ for too long to really understand why people find pointers hard, but I do remember that I did too at the beginning, and I do remember my epiphany (reading on the train, funny how I remember such senseless details 15 years later yet can&amp;#x27;t memorize a 4-item shopping list): given a declaration of&lt;p&gt;&lt;pre&gt;&lt;code&gt;    struct Foo {
        int a;
    };
    Foo* f;
&lt;/code&gt;&lt;/pre&gt;
, the following two are equivalent:&lt;p&gt;&lt;pre&gt;&lt;code&gt;    int b = f-&amp;gt;a;
&lt;/code&gt;&lt;/pre&gt;
and&lt;p&gt;&lt;pre&gt;&lt;code&gt;    int b = (*f).a;
&lt;/code&gt;&lt;/pre&gt;
Never had it spelled out for me like this, probably because it&amp;#x27;s so obvious once you get it - thought I&amp;#x27;d share in case it gives anyone else an &amp;#x27;aha&amp;#x27; moment.</text></comment>
<story><title>C for Python programmers (2011)</title><url>http://www.toves.org/books/cpy/</url></story><parent_chain><item><author>protomikron</author><text>IMHO pointers are mostly hard at the beginning because the asterisk-operator is overloaded: On one hand it declares (and optionally initializes) a pointer (type * x = ...;) and on the other it dereferences it (type y = * x;). At least for me that was the thing that puzzled me the most. I would prefer something like that:&lt;p&gt;&lt;pre&gt;&lt;code&gt;  &amp;#x2F;&amp;#x2F; declare and initialize x
  @uint32_t x = 42;

  &amp;#x2F;&amp;#x2F; dereference x
  uint32_t y = ~x;
&lt;/code&gt;&lt;/pre&gt;
I.e. have different symbols for the type and the dereferencer (&amp;#x27;@&amp;#x27; and &amp;#x27;~&amp;#x27; as an example).&lt;p&gt;&amp;#x2F;&amp;#x2F;edit: thanks for the help, fixed snippets - HN&amp;#x27;s parser does not get pointers either apparently :)</text></item><item><author>krat0sprakhar</author><text>I&amp;#x27;ve been programming in Python for a long time and recently took up an OS class which exclusively used C. Syntactic differences aside (declarations in C can get pretty hairy), the steepest learning curve while writing anything useful in C is with a) pointers and b) memory management which this guide doesn&amp;#x27;t seem to cover.&lt;p&gt;From my experience, the best way for learning C has been [0] Build Your Own Lisp and Zed Shaw&amp;#x27;s [1] Learn C The Hard Way.&lt;p&gt;That and of course spending countless hours debugging segfaults and memory leaks.&lt;p&gt;[0] - &lt;a href=&quot;http:&amp;#x2F;&amp;#x2F;www.buildyourownlisp.com&amp;#x2F;&quot; rel=&quot;nofollow&quot;&gt;http:&amp;#x2F;&amp;#x2F;www.buildyourownlisp.com&amp;#x2F;&lt;/a&gt;&lt;p&gt;[1] - &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;learncodethehardway.org&amp;#x2F;c&amp;#x2F;&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;learncodethehardway.org&amp;#x2F;c&amp;#x2F;&lt;/a&gt;</text></item></parent_chain><comment><author>emmelaich</author><text>You can consider them the &amp;quot;same&amp;quot; thing if you regard the asterisk as binding closer to the var instead of the type.&lt;p&gt;Which the declaration syntax hints at:&lt;p&gt;&lt;pre&gt;&lt;code&gt;   int i, *p;&lt;/code&gt;&lt;/pre&gt;</text></comment>