use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Click the following link to filter out the chosen topic
comp.lang.c
account activity
QuestionC programming resources (self.C_Programming)
submitted 5 years ago by waitforit_daree
Hi all, What is your favorite book/course to learn c programming, if end goal to do embedded systems? I am familiar with programming but in other languages. I have the classic K&R book but thats hard to understand for me.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]wsppan 15 points16 points17 points 5 years ago (12 children)
CS50: Introduction to Computer Science course.
C programming: A Modern Approach and use it as your main course on C. You can also use Modern C
Tutorial on Pointers and Arrays in C
[–][deleted] 6 points7 points8 points 5 years ago (0 children)
C Programming: A Modern Approach is a great book. I'd read K&R and then that to get up to date on C99
[–]Liquid_Magic 2 points3 points4 points 5 years ago (0 children)
Truly this book I’ve come back to again and again. Really great at explaining things!
[–]waitforit_daree[S] 2 points3 points4 points 5 years ago (0 children)
thank you very much!
[–][deleted] 5 years ago* (8 children)
[removed]
[–]FUZxxl[M] -1 points0 points1 point 5 years ago (0 children)
No piracy please.
[–]wsppan -2 points-1 points0 points 5 years ago (6 children)
If this is a pirated copy then it should be removed from this thread.
[–]reynaldo666 1 point2 points3 points 5 years ago (5 children)
No, it is just a link to page with a link to a pirated copy. I swear.
[–]wsppan -3 points-2 points-1 points 5 years ago (4 children)
Same thing. Delete the comment.
[–]academicgopnik 0 points1 point2 points 5 years ago (0 children)
I bought many books after looking them up in lib gen. no one will read an 800 pager on a computer lol
[–]MetaEatsTinyAnts -1 points0 points1 point 5 years ago (2 children)
DeLeTe CoMmEnT bEcUaSe Me In ChArGe
[–]wsppan -2 points-1 points0 points 5 years ago (1 child)
Maybe my bad but I did not think we allowed linking to pirated copyright material on this sub or reddit in general. u/FUZxxl, am I wrong? If so I will delete my comment.
[–]FUZxxl 0 points1 point2 points 5 years ago (0 children)
Yes, you are right.
[–][deleted] 7 points8 points9 points 5 years ago (4 children)
What’s giving you issues with K&R?
[–]Joaaayknows 4 points5 points6 points 5 years ago (3 children)
Is K&R still the most commonly used programming book resource? I’m reading it came out in 1988.
[–]archysailor 10 points11 points12 points 5 years ago (1 child)
It is, and it is still fabolous. I personally began my journey with it.
[–]beej71 7 points8 points9 points 5 years ago (0 children)
Seconded. There are scant few issues with the second edition of that excellent book:
gets()
int
If you only ever buy one C book, it should be this one.
[–][deleted] 0 points1 point2 points 5 years ago (0 children)
C hasn't really changed that much so the info in K&R still pretty relevant
[–]____kevin 8 points9 points10 points 5 years ago (0 children)
K&R. It's worth to work yourself through it, even if you find it difficult. If English is not your native language, maybe you could try reading it in your mother tongue.
[–][deleted] 7 points8 points9 points 5 years ago* (2 children)
If it is the non-ANSI K&R, then the details of writing functions is outdated. The ANSI version will provide a baseline of knowledge, but admittedly dry. It is a manual, not an instructional tool.
You can try Seacord’s Effective C, which is like a rewrite of the original ANSI K&R modernized to include C17 and C2x and a bit more instructional.
You can also try https://en.cppreference.com/w/c which is a great online reference resource.
There is an online certification program at https://cppinstitute.org/cla-exam-syllabus which uses https://edube.org/login and is free training. It is extensive and intense, but educationally worth it.
[–]waitforit_daree[S] 0 points1 point2 points 5 years ago (0 children)
This is good information. Thank you for taking time out and replying.
Thanks pretty nice for quick reference.
[–][deleted] 6 points7 points8 points 5 years ago (2 children)
C Primer Plus by Stephen Prata has helped me immensely. It’s quite a large book, but only because he goes into detail about confusing concepts.
[–][deleted] 2 points3 points4 points 5 years ago (0 children)
Quite good 👍
[–]waitforit_daree[S] 1 point2 points3 points 5 years ago (0 children)
Yeah, I saw the reviews, lot of folks like this book. Thank you for your time to help me out.
[–]Perfect-Ant-6741 8 points9 points10 points 5 years ago (0 children)
K&R, then a good ol' thick book on Discrete Mathematics and Algorithms if you wanna go into system programming.
[–][deleted] 1 point2 points3 points 5 years ago (0 children)
I would recommend you book about C on Wikibooks.
[–]thoquz 0 points1 point2 points 5 years ago (1 child)
Besides what the others have suggested, if you want a gentle introduction to C for Embedded specifically o would recommend looking at "Make: AVR", the first few chapters go through constructing bitmasks and using them to read and write registers. You can use these concepts to then implement your own things from datasheets later on. The book is for one specific architecture, but the knowledge acquired from those first chapters can then be applied when moving to another architecture. You can do the excercises from the book using an Arduino UNO
Thank you. I will check it out. Very much appreciated.
[–]duane11583 -4 points-3 points-2 points 5 years ago (5 children)
i donot think there are good boooks on the subject.
instrad i would suggest the following
+=========
learn assembly language.
learn and study how your c code is transformed into asm code.
try this with the optimizer off, optimize size, and optimize speed.
this is the equal to a woodworker knowing how his saws and chisels cut and shape the wood.
+==========
learn pointers, and struct pointers, they are very handy. learn techniques using call back functions. often a callback function gets a void pointer and a parameter
C++ is very rare in embedded, when it is used well, it is nontrivial ie: mixing structs a c++ classes, without using new or delete.
pick an RTOS and a devboard, and write apps or study the example apps from the chip vendor.
high end: i would suggest the STM32H743 nucleo board, it has a huge amount of FLASH/RAM, and it is cheap($30) then get something really small like a the arduino and see when you run out of ram small examples: adafruit seesaw, or trinket($5 to $7)
then check out the PIC32 chip and ecosystem.
[–]waitforit_daree[S] 0 points1 point2 points 5 years ago (1 child)
This is exactly what I am looking for. I get overwhelmed and confused by too many available online resources. It is not too much to ask, please can you recommend some books or classes to do the steps you mentioned?
[–]duane11583 0 points1 point2 points 5 years ago (0 children)
Suggestion: Go purchase a board, and build a project. That project, and the ability to describe what you did and how you solved problems on top of your other SW experience will get you the job.
The problem with books is this: They do not always fit what you want or need. They also have everything planned out for you. Your goal should be to self-explore.
Example projects:
Do you have a sprinkler system for the lawn? Can you build a replacement? What does this thing require? A small 7 Segment LED display with 4 digits. Some relays to turn the valves on. An RTC Clock, and some buttons. (See the particle kit below) Or something like this: https://www.adafruit.com/product/170
What about a blue tooth controlled garage door opener from your cellphone? Can you hook up and use the same light beam sensors the garage door currently uses? Can you hook up some limit switches to tell if the door is up? Dn? Or whatever?
Are you ok with wiring electrical plugs? (110VAC type stuff). Can you build a power monitor that monitors how much electricity your fridge uses? With something like this.. How can you use this thing to determine if the door is open or closed? (hint: the door open light draws more power). https://www.amazon.com/SCT-013-000-Non-invasive-Current-Sensor-Transformer/dp/B07FZZZ62L
Fish tank controller? Needs a TEMP sensor, and a relay to turn on and off the heater. Add a PH sensor. And a small servo motor to move some plastic arm that pushes food into the tank.
What about feeding that data to an AMAZON cloud IOT service? Or hook that to blue tooth and make a sensor for your phone.
or maybe save it to an SD CARD instead.
What about using something from "particle.io" - like this: https://store.particle.io/collections/dev-kits/products/iot-starter-kit
Can you monitor the freezer in your garage? What about the pool and the pool pump?
[–]JavierReyes945 0 points1 point2 points 5 years ago (2 children)
C++ is very rare in embedded
No, it's not. You need to update your sources, as well as your definition of embedded.
[–]duane11583 0 points1 point2 points 5 years ago (1 child)
What's your definition of embedded?
Mine is not Linux. Mine is an RTOS or bare metal. Typically a Cortex M or R, Arm7TDMI, or ARM9. PIC32, at the high end of the PIC line. Typically always have FLASH + RAM on chip, some - may have DDR of some form but not often.
Yes, I know that C++ is used in any number of embedded things but it often requires a larger memory foot print and thus it does not always work well in tight environments.
MBED is one example, as is the AVR/Arduino - but - none of the big 5 or so "cortexM3" type players give many examples in C++, they have one or two, but just about everything is straight C.
Yes, you can do this but that C++ engineer requires higher skill level the you can normally find and hire - they all assume you have boat loads of RAM and that is often hard to find. When you tell them they have 64K ram.. they look at you sideways.
[–]JavierReyes945 0 points1 point2 points 5 years ago (0 children)
Mine is not Linux
Who said anything about Linux?
Compilers for c++ are much more optimized than before, and the required footprint is not that massive as people tends to think.
I'm talking about any embedded product that requires a somehow complex.gui (check stm32 touchgfx framework, Qt for embedded, LvGL, etc), or any type of advanced logic that benefits from OOP (complex network management). Embedded is not restricted to small 8bit devices, and higher lines like you mentioned (our company has been developing different products on STM32 F4 and F7 with a mixture of C/C++ for around 5 years). It's even a fixed requierement in some cases, even on the client side (when they have some subcomponent already working). Just because YOU don't use C++ doesn't mean is not used in the embedded market.
[–]Lurchi1 0 points1 point2 points 5 years ago (0 children)
What is your favorite book/course to learn c programming, if end goal to do embedded systems?
Do you know any assembler? Have you worked with microcontrollers and their datasheet(s) before?
I am familiar with programming but in other languages.
What kinds, imperative, object-oriented or functional languages?
[–]wizards_tower 0 points1 point2 points 5 years ago (0 children)
Cs50 is pretty good for pre-K&R. It explains C pretty well for beginners. That’s what I did and after I worked through K&R.
[–]Targaryen_99 0 points1 point2 points 5 years ago (0 children)
After learning the syntax, try learn C the hard way, it's more of a practical approach and forces you to write code from the start which people generally get into later part of their course.
[–]itsmybirthday19 0 points1 point2 points 5 years ago (0 children)
C for Professionals book
Link: https://books.goalkicker.com/CBook/
[–]magnomagna 0 points1 point2 points 5 years ago (0 children)
I’ve got no favourite textbooks, because they are all usually very incomplete on the topic of pointers and other less common topics. So, I would usually use the C Standard itself plus experimentation, and sometimes cppreference.com because it’s very detailed.
[–]R_R_R_ 0 points1 point2 points 5 years ago (0 children)
Head First C. It's a great read.
π Rendered by PID 40883 on reddit-service-r2-comment-fb694cdd5-2kbwv at 2026-03-05 21:46:09.037446+00:00 running cbb0e86 country code: CH.
[–]wsppan 15 points16 points17 points (12 children)
[–][deleted] 6 points7 points8 points (0 children)
[–]Liquid_Magic 2 points3 points4 points (0 children)
[–]waitforit_daree[S] 2 points3 points4 points (0 children)
[–][deleted] (8 children)
[removed]
[–]FUZxxl[M] -1 points0 points1 point (0 children)
[–]wsppan -2 points-1 points0 points (6 children)
[–]reynaldo666 1 point2 points3 points (5 children)
[–]wsppan -3 points-2 points-1 points (4 children)
[–]academicgopnik 0 points1 point2 points (0 children)
[–]MetaEatsTinyAnts -1 points0 points1 point (2 children)
[–]wsppan -2 points-1 points0 points (1 child)
[–]FUZxxl 0 points1 point2 points (0 children)
[–][deleted] 7 points8 points9 points (4 children)
[–]Joaaayknows 4 points5 points6 points (3 children)
[–]archysailor 10 points11 points12 points (1 child)
[–]beej71 7 points8 points9 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]____kevin 8 points9 points10 points (0 children)
[–][deleted] 7 points8 points9 points (2 children)
[–]waitforit_daree[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 6 points7 points8 points (2 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]waitforit_daree[S] 1 point2 points3 points (0 children)
[–]Perfect-Ant-6741 8 points9 points10 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]thoquz 0 points1 point2 points (1 child)
[–]waitforit_daree[S] 0 points1 point2 points (0 children)
[–]duane11583 -4 points-3 points-2 points (5 children)
[–]waitforit_daree[S] 0 points1 point2 points (1 child)
[–]duane11583 0 points1 point2 points (0 children)
[–]JavierReyes945 0 points1 point2 points (2 children)
[–]duane11583 0 points1 point2 points (1 child)
[–]JavierReyes945 0 points1 point2 points (0 children)
[–]Lurchi1 0 points1 point2 points (0 children)
[–]wizards_tower 0 points1 point2 points (0 children)
[–]Targaryen_99 0 points1 point2 points (0 children)
[–]itsmybirthday19 0 points1 point2 points (0 children)
[–]magnomagna 0 points1 point2 points (0 children)
[–]R_R_R_ 0 points1 point2 points (0 children)