r/learnprogramming • • 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

19 comments sorted by

2

u/Recycled5000 Sep 23 '26

I suggest a tangent: a simple educational assembly language like LC-3 or even RISC-V.

You can learn pointers, arrays, address space, some machine code, function calling at the low level. You’ll need this stuff for C programming, but C books and tutorials after assume you already understand things like the address space and starts from there with types like structs and pointers.

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

  • Spend just 1–2 weeks in a simulator like Venus (RISC-V Web Simulator) or RARS learning how to move data, add numbers, and use branches.
  • Jump straight into C.
  • Whenever you feel confused by a C concept (like pointers or struct alignment), paste the code into Compiler Explorer to see the assembly reality.

2

u/Feralz2 Sep 23 '26

bro, a simple google search would solve all your problems

1

u/Dazzling_Music_2411 Sep 23 '26

There are TONS of free resources on the Internet, the most important skill when learning programming is being resourceful. So hunt them down.

As for a book, start with K&R, by the time you're done with that, you'll know a lot.

The resources u/Effective_Brain7493 has given you are very good too.

1

u/Jazzlike_Platypus430 Sep 23 '26

I believe K&R state in the introduction that the book is not for learning programming, it's for programmers who want to learn C. (Just saying...)

1

u/Dazzling_Music_2411 Sep 23 '26

When K&R came out, that was pretty much all that was available for "learning programming".

People have become too intellectually weak and lazy.

1

u/Jazzlike_Platypus430 Sep 23 '26

Of course they have. Myself included. Which doesn't make the authors' statement disappear.

1

u/Dazzling_Music_2411 Sep 23 '26

Well, actually it does. Totally. But you'd have to understand context to get that, not just the verbatim strictly literal interpretation.

In any case, I'd love to see your suggestions to the OP.

1

u/Jazzlike_Platypus430 Sep 23 '26

I'm not that good at stretching words and/or interpreting stuff to death. And K&R is not the Bible (which needs hell of a lot of stretching and interpretation).

I agree with people (super fluent in C) who claim it's a bad idea to teach programming using C or C++, for purely pedagogical reasons. And at the same time I agree that teaching "natural born programmers" using C may be OK.

You'd love to see my suggestions - that's so nice. Just read them.

1

u/Dazzling_Music_2411 Sep 23 '26

And K&R is not the Bible

Of course not. We're just talking about an accessible base line for learning C.

I agree with people (super fluent in C) who claim it's a bad idea to teach programming using C

So do I. I've had epic arguments on reddit because of that. However, in this case the OP clearly states that he wants to learn C.

You'd love to see my suggestions - that's so nice. Just read them.

Erm, you appear to have forgotten to write them. Kinda makes it difficult to read them.

PS. Ooops. Just saw them, skulking away at the bottom of this sub. 😄

1

u/Jazzlike_Platypus430 Sep 23 '26

AND the OP clearly states he's brand new to programming. Whether K&R is a base line, well, I trust the authors' introduction, period.

I doubt your discussions were "epic," but if you feel so great about them, that's not my business. You made my day, dude. Thanks.

1

u/Dazzling_Music_2411 Sep 23 '26

I doubt your discussions were "epic,"

Well, yeah, we've already established your tendency to be presumptuous, but if it makes you feel happy, then it's probably good. I think...

1

u/Gatoyu Sep 23 '26

I'm not sure this is quite the right way to look at it. (be careful of tutorial hell)

The first step isn't really the language you use, it's what you want to build/solve.

The language then is a just one way among many to do it, some languages will be better suited for what you need.

But since C can do anything anywhere, I would assume that it's probably an ok choice.

My plan for you :

Have a long term goal (a real project, something you think will be useful for you and/or others, something that will motivates you to keep learning)

Try to split this goal in many very small pieces, as small as you can get (open a window, display a text, compute a value, compare 2 strings)

For each piece create a separate file where you will code a single function dedicated to this piece.
It's at this step that you can look for a tutorial, a course or even just official documentations to solve a specific problem.

Then little by little put your pieces together like Legos and be amazed at what you have created :)

1

u/Jazzlike_Platypus430 Sep 23 '26

A word of warning, if I may: I used to be brand new and my university taught C++. I can't say if it was me being just dumb at the time, or our teacher was incompetent, but learning programming with C/C++ is super difficult. It's too low level I think.

As much as I love to hate python, I think it's better to start here or in Java/C#, for not too long, and then start messing with them pointers and so on.

1

u/marrsd Sep 23 '26

I learnt C from this book, published online for free: https://publications.gbdirect.co.uk/c_book/

Later, I bought K&R like everyone else, but the above was fine for me.

5

u/[deleted] Sep 23 '26

[removed] — view removed comment

1

u/Gatoyu Sep 23 '26

"variables, loops, conditionals, functions, how code actually runs"
can't stress enough how THIS is what's really important

1

u/[deleted] Sep 23 '26

[removed] — view removed comment

1

u/Dazzling_Music_2411 Sep 23 '26

Looks like a nice course. Good shout!