Floxi wrote: ↑Tue Dec 03, 2019 3:24 pm
The already mentioned beginner's book by Simon Long got updated a while ago with a GUI section and I highly recommend it to absolute beginners. It's a really great start.
https://magpi.raspberrypi.org/books
Youtube videos are great, but it's extremely hard to look up stuff you might have missed or forgotten later, that's why I prefer books. (E.g. "C Primer Plus" or "C How to Program");
Even if you learn the basics from internet tutorials, "Understanding and Using C Pointers" is highly recommended as it does a terrific job at teaching the ins and outs of pointers.
As for the "Hello World" example: It's an absolute non-issue. Firstly, every half-decent IDE marks this specific error, and secondly, mixing up operators is a sign of lazy programming and can lead to horrific results which often only can get detected at runtime.
It is nice to see a new edition of that introductory C programming book. I still find it strange that the author persists in the error of writing
void main()
rather than the correct
int main()
In my opinion, it does not reflect well on the MagPi publishers that the author's insistence on intentionally making this error was not overridden by technical review and editor oversight. At the same time, I greatly appreciate a book that teaches introductory programming for true beginners using a language that wears as well with continued use as C does. Thank you!
One thing missing from the present thread on learning C is how important it is to choose a suitable programming project to motivate the learning. In my opinion, only by writing code is it possible to learn any kind of computer programming. Unfortunately, beginners often want to write a full symphony before creating a few tunes.
The reason for this may be a source of examples: While there are many songs made by beginning musicians that play guitar and sing, there are relatively few GitHub repositories that consist of fun programs written in C that are simple enough for a beginner to understand, improve and learn from. Moreover, those repositories that do exist are not popular, hummable or easy to find.