r/cprogramming • • Sep 29 '26

what is the best book for learning c

17 Upvotes

22 comments sorted by

18

u/zhivago Sep 29 '26

Personally, I still think that K&R is the best with the least junk.

But given that people don't seem to learn state machines anymore, the exercises may seem harder than they are.

13

u/Ok_Loan_9047 Sep 29 '26

K&R is great but you write C like an old nerd 😅

8

u/shimoco Sep 29 '26

I am an old nerd.

1

u/picturesfromthesky Sep 30 '26

Yeah I mean I think there’s language syntax, and then there are programming patterns. K&R is amazing for the language fundamentals and syntax, but there are more modern patterns. If you take the time to really fork k&r anything mess will come easily.

1

u/Ok_Debate4690 Sep 29 '26

the problem with is its just old. do u have anything that is a bit newer

1

u/gm310509 Oct 01 '26

It is only as old as the language itself. The getting started basics will be the same.

2

u/Mathie1729 Sep 29 '26

K&R is still the cleanest, but it only covers C89. If you're learning C today, pair it with something that mentions C99/C11 features like designated initializers and stdint, or you'll hit syntax in real code that K&R never explains.

1

u/mathaic Sep 29 '26

I have come back to C specifically for state machines

11

u/HyperWinX Sep 29 '26

The one that you've found in subreddit's sidebar. You've read the whole sidebar, right?

2

u/SLOOT_APOCALYPSE Sep 29 '26

Hey I didn't even know haha, I love how it's called "the book" yes it is THE BOOK for sure. K&R is the bedrock

7

u/AtlantaRene Sep 29 '26

K&R is most direct and to the point. Also consider C PROGRAMMING: A Modern Approach by K. N. King.

5

u/Arkaqiu Sep 29 '26

I like modern c by Jens Gustedt and Extreme C by Kamran Amini.

Very good books, present good practise in archcotecture, data management and proven patterns in C programming.

1

u/BigLeagueChew4u Sep 29 '26

Never heard of these thanks for the recommendation.

3

u/irk5nil Sep 30 '26

K&R's The C Programming Language is a classic, but the language described is very old.

You might want to look at:

  • Jens Gustedt's "Modern C", 3rd Edition describes C23. It's the most recent book you'll find, but the contents can be challenging if you're very new to programming. It's also available online, so you can check it out at any time.
  • K. N. King's "C Programming: A Modern Approach" is a bit older, but still covers C99 and it's very didactic and readable in my opinion. The one disadvantage is that you lose out on the useful post-C11 features like threading and such, but you can always read "Modern C" later for that.

3

u/studiocrash Sep 29 '26

“Effective C” or “Beej’s Guide to C Programming “.

1

u/echelon_code Sep 30 '26

K&R is excellent. another i'd recommend: "Schaum's outline of theory and problems of programming with C" (Gottfried, Byron) its old and difficult to find, but i think it's very good

1

u/gm310509 Oct 01 '26

You won't learn from a book (or youtube, AI et al).

The book will lead you. You will actually learn by trying out the exercises and concepts yourself (and experimenting with them).

As for which one? I learned from the K+R book. As others have mentioned there is a bit of a list in the sidebar.

As to which is "the best", that is sort of a personal choice. Everybody learns differently and thus will have different opinions as to which is best.

But if it starts out with the basics and has plenty of things for you to try it is probably pretty good.

IMHO.

1

u/neopunk2025 Oct 25 '26

C by exemple (C par l'exemple)

-2

u/suboculus Sep 29 '26

well grounded rubyist by david a.black