C Primer
It&#x27;s been way too long since I&#x27;ve learned C for me to put myself in the shoes of somebody attempting to learn it for the first time but it&#x27;s a bit steep for a &quot;primer&quot;, isn&#x27;t it? I mean just looking at the examples it goes from introducing structs to a complex examples dealing with malloc, free, enums, pointers, NULL, arrays and for loops.<p>I also think the section about &quot;the machine&quot; is interesting but it&#x27;s a bad idea in a C tutorial. When you code C you code for the C abstract machine, not your CPU. It&#x27;s very important to understand that difference, especially if you want to write portable code. For instance integer overflow is most likely very well defined on your machine, but it&#x27;s not in the C virtual machine. C is not a macroassembler. Furthermore I really don&#x27;t think the details in this sections are relevant in the early stages of learning C.<p>There also are a few technical inaccuracies:<p>&gt;So bytes (chars) can go from -128 to 127, shorts from -32768 to 32767, and so on. By default all of the types are signed (except pointers) UNLESS you put an “unsigned” in front of them.<p>That&#x27;s true on most systems but &quot;char&quot; can be either signed or unsigned (IIRC on ARM they default to unsigned) and the C standard only gives minimum ranges, so 32bit chars and 64bit shorts are theoretically possible (and can occur on systems where the smallest addressable value is larger than 8 bit such as some DSPs). It&#x27;s pure nitpick of course but why even bother mentioning that in a C intro? Introduce stdint.h instead, that&#x27;s actually very useful for any C coder.<p>&gt;You can have a pointer to pointers, so de-reference a pointer to pointers to get the place in memory where the actual data is then de-reference that again to get the data itself<p>&gt;So keep this in mind as a general rule - your data must be aligned.<p>&gt;Note that in addition to memory, CPUs will have “temporary local registers” that are directly inside the CPU.<p>Are we seriously talking about nested pointers, alignment and CPU registers before we&#x27;ve even introduced printf? If a newbie manages to get past that and continue through the examples I congratulate them.<p>I don&#x27;t want to sound too harsh, it&#x27;s definitely very commendable to try and share your knowledge with other people and writing tutorials is very time consuming and not always very rewarding. That being said I definitely wouldn&#x27;t advise anybody to start learning C using that document, especially since there&#x27;s already a wealth of resources for learning C, both online and off.