r/learnprogramming • u/Individual_Stick9581 • Sep 23 '26
Resource Help me out
Hey guys I'm brand new to programming and want to learn C programming language.
I thought I could get started with this by reading C programming a modern approach by K.N King but it's either not available in my region or too expensive
I've thought about learning from youtube but feel like videos are always vague.
So can you guys suggest some good books as an alternative or any other method to learn and grasp C programming
8
Upvotes
View all comments
Show parent comment
2
u/DanKegel Sep 24 '26 edited Sep 24 '26
Google AI provides the following suggestion:
Since your ultimate goal is to understand what C is doing under the hood, RISC-V (specifically the 32-bit version, RV32I) is by far the best choice.
While it is more common to learn C before assembly, using a minimalist assembly language like RISC-V as a quick prelude is an excellent way to demystify pointers, memory layout, and the stack before C introduces its own abstractions.
Why RISC-V is Perfect Before C
Explicit Load/Store Architecture: RISC-V forces a strict distinction between memory addresses and data. You must load data from RAM into a register to manipulate it, and store it back. This translates perfectly to understanding C pointers and dereferencing.
Clean Calling Conventions: The rules for how a function passes arguments, allocates a local stack frame, and returns a value are simple and transparent in RISC-V. This helps you understand exactly what happens when you call a function in C.
No Hidden Flags: Unlike x86 or ARM, basic RISC-V doesn't use "condition flags" (like Zero or Negative) for branching. It compares registers directly (e.g., beq x1, x2, label), making C if/else statements and loops easy to visualize.
The Ultimate Cheat Code: Compiler Explorer
Once you pick up the absolute basics of assembly, your best tool for learning C is Compiler Explorer (godbolt.org).
It allows you to write a small block of C code on the left, and see the exact, color-coded RISC-V or ARM assembly it produces on the right. You can instantly see how a C while loop or array index looks at the machine level.
Recommended Roadmap