<story><title>C for high level programmers (slides)</title><url>http://charliethe.ninja/slideshow/introtoc.html</url></story><parent_chain></parent_chain><comment><author>_kst_</author><text>Slide 31 says:&lt;p&gt;&lt;pre&gt;&lt;code&gt;    Actually, this is how arrays are handled in C.
    A C array is a set of consecutive memory addresses.
    The first value is pointed to by a pointer.

    int a[] = {1, 2, 3}; &amp;#x2F;&amp;#x2F; create an array
    &amp;#x2F;&amp;#x2F; a is just a pointer to the first element...
&lt;/code&gt;&lt;/pre&gt;
No, &amp;quot;a&amp;quot; is an array, not a pointer. Defining an array object does not create a pointer. The expression &amp;quot;a&amp;quot; is implicitly &lt;i&gt;converted&lt;/i&gt; to a pointer to the array&amp;#x27;s first element in most but not all contexts.&lt;p&gt;If &amp;quot;a&amp;quot; were nothing more than a pointer to the first element of the array, then &amp;quot;sizeof a&amp;quot; would yield the size of a pointer rather than the size of the array object.&lt;p&gt;This is all explained very well in section 6 of the comp.lang.c FAQ, &lt;a href=&quot;http:&amp;#x2F;&amp;#x2F;www.c-faq.com&amp;#x2F;&quot; rel=&quot;nofollow&quot;&gt;http:&amp;#x2F;&amp;#x2F;www.c-faq.com&amp;#x2F;&lt;/a&gt;.</text></comment>
<story><title>C for high level programmers (slides)</title><url>http://charliethe.ninja/slideshow/introtoc.html</url></story><parent_chain></parent_chain><comment><author>TheAceOfHearts</author><text>I think the problem with learning C is that you need to learn stuff like make, autoconf, how the compiler + preprocessors work (what do all those flags even mean!?), how making &amp;quot;cross-platform&amp;quot; stuff works, how to pull in and use &amp;quot;libraries&amp;quot;, C-isms, how to test, etc. C itself is a very small and simple language, but the tooling and patterns are old and mysterious.&lt;p&gt;In college I learned how to program embedded systems with C (and ASM). Once I knew how to debug, build, and push it onto the device, it was surprisingly easy and beautiful. There&amp;#x27;s no confusing and magical abstractions, it&amp;#x27;s just you and the hardware. You pull up the microcontroller&amp;#x27;s manual, and as long as you have an idea of what the lingo means, you can make it dance to your will.&lt;p&gt;Something I disliked was that with both microcontrollers I used, there was dark magic involved in building and uploading your binary. One of the devices provided examples for a specific IDE, so I imported that example and used it as a base. I could keep modifying it and keep adding files, but I never managed to setup a &amp;quot;new&amp;quot; project. The other device was similar, but instead of using an IDE it provided a Makefile, which was nicer.&lt;p&gt;Does anyone know any good resources on learning and writing real-world C? I&amp;#x27;ve looked at C projects here and there over the years, with the most interesting being GNU Coreutils... But even if I can eventually understand what some code does, how do I learn why it does it that way?&lt;p&gt;I&amp;#x27;d love for a guide that showed things like: &amp;quot;do X and Y because of this and that&amp;quot;, &amp;quot;test X and Y by running the following&amp;quot;, &amp;quot;write tests using XYZ&amp;quot;, &amp;quot;debug X using Tool A, and Y using Tool B&amp;quot;, &amp;quot;pull in this library by copying these files into these places, and use it by adding the following lines to the following files&amp;quot;, &amp;quot;generate docs by pulling in this tool and set it up by doing the following&amp;quot;, etc.&lt;p&gt;In the web world there&amp;#x27;s a massive set of problems, but it tends to be easy to find &amp;quot;boilerplate&amp;quot; generators that will get you up and running. And after you&amp;#x27;ve tried out a few of them, you can usually pick up how people are mixing and matching different tools.&lt;p&gt;EDIT: Another comment linked to &amp;quot;Learn C The Hard Way&amp;quot; [0], and after browsing through the chapters it seems to cover a lot of the topics I&amp;#x27;m interested in.&lt;p&gt;[0] &lt;a href=&quot;http:&amp;#x2F;&amp;#x2F;c.learncodethehardway.org&amp;#x2F;book&amp;#x2F;&quot; rel=&quot;nofollow&quot;&gt;http:&amp;#x2F;&amp;#x2F;c.learncodethehardway.org&amp;#x2F;book&amp;#x2F;&lt;/a&gt;</text></comment>