r/cprogramming • u/bayviewrocker82 • Dec 22 '25
How do I even start learning C?
I'm a technical writer by trade, but would like to learn more about programming. I've spent some time learning Python but find the idea of lower-level languages a bit more interesting.
What actually got me interested in bothering to learning C is how well-written K&R is. I keep a printed copy on my desk for reference as I work on material very similar to it (many of the products I support are embedded products).
I'm admittedly a more hands-on learner and want to be able to see up-close why something works.
Ideally, closer to bare metal than anything, to get a start. Even just getting an LED to blink or a servo to actuate would be very exciting and a huge step.
I am thinking a Pico might be a start... thoughts?
Thanks :-)
8
u/IdealBlueMan Dec 22 '25
If you’re on Mac, you already have a UNIX system. I forget whether it comes with a C compiler, but you can download Gnu C or Clang for free.
On Windows, I generally get VirtualBox and set up a machine with Mint or Ubuntu. Then get the common Gnu C tools. Best to be comfortable with command line tools.
Unix and Linux give you a more standard development environment than Windows.
4
u/JohnVonachen Dec 22 '25
Acquire the latest Deitel and Deitel book on c and read it and do the exercises.
2
u/fatemonkey2020 Dec 22 '25
I have a pico myself and I think its a great little microcontroller. You can DM me if you want some C tutoring with a focus on the pico.
4
u/Pass_Little Dec 22 '25
Get an arduino. Go through some tutorials.
There are starter kits you san get on Amazon such as the elegoo r3 starter kit which includes a clone arduino and a lot of sensors.
That will get you started. Arduino is actually C++ with a bunch of libraries that makes interfacing to the hardware easier.
My only concern in recommending this path is that arduino has done a good enough job with the libraries that you end up learning more about the hardware than actually C programming.
3
u/[deleted] Dec 22 '25
Harvard CS50
1
u/[deleted] Dec 22 '25 edited Dec 22 '25
A pi pico would probably be an excellent platform for learning. Depending on how new you are to embedded (you mention you support embedded products so I assume you feel relatively confident with embedded as a concept), there might be options with more handholding (anything arduino) or less handholding (baremetal, some stm32s).
A blink is a fairly nice "hello world" style tutorial. I would also suggest a stepper buzzer, playing tunes on a stepper is always fun :) Otherwise: reading sensors (multiple at a time), blinking multiple leds with different timings, driving a small screen, creating a line following robot, making a wire wrapping machine, doing some communication over ethernet, can, or some other longer range protocol.
Note that the C you end up learning for these platforms will be fairly straightforward, but will have some idiosyncracies. ISRs might require wrapping in
__attribute__((naked)), to avoid unncessary (or worse, stack corrupting) function prologues, depending on what microcontroller you pick. The resource constraints of microcontrollers are not new to you, I am sure. Some extra care must be taken if doing stuff baremetal (my favourite, provides both more opportunities to learn, and more work and footguns for you to deal with).The sky is the limit, but hopefully some of those ideas are realistic and actionable. In any case, do let us know what yoy choose to pick, and how it turns out!
P.s. for embedded specifically, there are other subreddits like r/embedded, or communities for particular chip families, which you might want to ask in.
1
u/Social_throwaway244 Dec 22 '25
printf("Hello World");
1
u/Zen-Ism99 Dec 22 '25
Library books…
1
u/nedovolnoe_sopenie Dec 22 '25
it's always ritchie & kernighan
1
u/TarnishedVictory Dec 22 '25
Look up some tutorials and just work through them.
1
u/grimvian Dec 23 '25
Learn to program with c by Ashley Mills
https://www.youtube.com/playlist?list=PLCNJWVn9MJuPtPyljb-hewNfwEGES2oIW
I don't use the same IDE, the program you use write code in, but Code::Blocks, because it's easy and fast to install, easy to use, everything is ready from start and it's open source!
1
u/photo-nerd-3141 Dec 24 '25
K&R describes the language succinctly with examples, second half of the book is a good reference.
Sedgewick, Algorithms in C shows how to use it with readable style and excellent graphics.
P.J. Plauger, The Standard C Library shows you how to make it work effectively & portably. His Intentional Programmer books are also good. The thing he does well is keep an otherwise dry subject interesting.
1
u/alex_sakuta Dec 24 '25
If you have never seen C syntax/never used C, create a file parser. Open a file, parse it for information, close it safely. Then try to open multiple files and collect similar information and close them safely with multithreading.
Refer to Linux man pages for it.
If you know the C syntax/have used C. Write a multi-threaded HTTP server.
1
u/ScholarNo5983 Dec 25 '25
If you are running Windows, then MinGW is a nice option. MinGW is a port of the GNU C and C++ compilers to Windows.
As shown in the link below the installation is very easy:
Installing C/C++ GNU Compilers on Windows Using MinGW
1
u/egh128 Dec 27 '25
C Programming for Dummies. It’s a great introduction.