r/C_Programming • u/LuciusCornelius93 • Apr 19 '25
How to learn C in 2025
I’m a total beginner when it comes to programming, and I’ve decided I want to start with C. My goal isn’t just to follow along with some random tutorials that show you how to write code without actually explaining why things work the way they do. I really want to understand the fundamentals and the core concepts behind programming, not just memorize syntax.
So I was wondering—could anyone recommend some solid books that would help me build a decent understanding of the basics? Something that really lays the foundation, especially through the lens of C. Appreciate any suggestions!
131
u/ThePhysicist96 Apr 19 '25
https://beej.us/guide/bgc/html/split/index.html
Thank me later.
120
u/QwazeyFFIX Apr 19 '25
There is a famous book called "The C Programming Language". Thats what I bought 20 or so years ago and learned with as a kid, and by that time the book was already like 20 years old.
Its pretty much the defacto starting point for C.
65
u/wsppan Apr 19 '25
I've posted this here before and it's what has worked for me an a few others who told me it worked for them as well. Ymmv.
People sometimes struggle with C when they start from scratch or come from a higher to lower level of abstraction. I struggled with this for a long time till I did these things:
I would not try and understand how the higher level abstractions translate to the lower C level. I would instead learn from first principles on how a computer works and build the abstractions up from there. You will learn how a CPU works. How the data bus and registers are used. How memory is laid out and accessed. The call stack and how that works, etc.. This will go a long way in understanding how C sits on top of this and how it's data structures like arrays and structs map to this and understanding how pointers work the way they do and why. Check out these resources:
The first four really help by approaching C from a lower level of abstraction (actually the absolute lowest level and gradually adding layers of abstraction until you are at the C level which, by then is incredibly high!) You can do all four or pick one or two and dive deep. The 5th is a great introduction to computer science with a decent amount of C programming. The sixth is just the best tutorial on C. By far. The seventh is a deep dive into pointers and one of best tutorials on pointers and arrays out there (caveat, it's a little loose with the l-value/r-value definition for simplicity sake I believe.)
https://github.com/practical-tutorials/project-based-learning#cc
Play the long game when learning to code.
You can also check out Teach Yourself Computer Science
Here is a decent list of 8 Books on Algorithms and Data Structures For All Levels
16
u/grimvian Apr 19 '25
Must be:
Intro to Systems Programming, the C Language, and Tools for Software Engineering
By Kris Jordan
https://www.youtube.com/playlist?list=PLKUb7MEve0TjHQSKUWChAWyJPCpYMRovO
9
u/jonsca Apr 19 '25
https://gustedt.gitlabpages.inria.fr/modern-c/ is one of the better books out there that gives you some of the "why" along with the "how." It also talks about the newest standards, which the other textbook-like books do not.
7
u/InfinitEchoeSilence Apr 20 '25
C Programming A Modern Approach 2nd Edition — K.N. King
I have basically ALL of the books out there and that one is the best.
6
u/imihnevich Apr 19 '25
Is K&R still a thing? I remember enjoying it when I was a kid
5
u/[deleted] Apr 19 '25
C Primer Plus by Prata.
C: A Modern Approach by King.
9
u/SputnikCucumber Apr 20 '25
Lots of advice here with books. I'm gonna offer some different advice to complement everyone's recommendations. This is advice I wish someone had given me when I was a complete beginner.
C programming (as opposed to programming in general) mixes two ideas together. One is the idea that computer hardware; that is the wires, components, and electrical signals that make a computer work can be configured through an expression of language that is called programming (now it is sometimes called systems programming). The other idea is that we can use a computer to achieve any goal that can be quantified by telling it (or teaching it) how to work towards that goal, this is the more common use of the word programming (and it includes machine-learning techniques).
At the building blocks level (electricity and wires) there isn't any meaningful difference between the two. Because C was designed at a time when computers weren't much more than just those building blocks, C programming has a very particular style (like a dialect, or a style of speaking) that doesn't really distinguish between these two types of programming.
Data structures and algorithms are most at home in the modern sense of the word programming. These are tools and techniques that are used to teach a computer how to work towards an objective.
Memory management, arithmetic, function calling, and a variety of other details belong to programming in the traditional sense (systems programming).
When learning to program in C, you will be forced to learn both of these ideas together. At different times, you will find one of these concepts to be harder than the other. Do not be afraid to take the two parts at different paces. If you find systems easier, then you shouldn't feel constrained by a need to slog through algorithms you aren't using to learn more about systems and vice versa. This being said, my experience is that the one you find hardest almost always alternates because there is so much depth to both. So don't expect the one you find easy to be easy forever.
4
u/r0r0r0 Apr 19 '25
Printing out the C Manual and reading it through worked well for me: https://www.gnu.org/software/gnu-c-manual/gnu-c-manual.pdf
3
u/iqbal002 Apr 20 '25
Just curious, does learning a subject changes by each passing year I mean what's the difference in learning C In 2020 and 2025?
3
u/duane11583 Apr 20 '25
the biggest thing is to learn how to write down a list of instructions. then break down those steps into smaller steps repeating this until you have simple implementable steps.
the classic joke/video is “ask a kid how to make a peanut butter sandwich” software is like that.
another is what is called a function, and what is called variable scoping.
example: wake up, get out of bed, take shower, use restroom, eat breakfast, goto work/school.
in that process did you walk? so that is a function. ie walk( destination )
to walk did you use a muscle? are these functions? ie contract( muscle number) and release(muscle number)
that exercise of breaking down steps into smaller manageable steps is at the heart of programming in any language
======
another aspect to consider is this: the language C verses the standard library functions
for example the classic printf() function is technically not part of the language instead it is part of the standard library of functions available to you.
again i go back to the break down steps into manageable steps… printing some text is a very common step so common that it is standardized into a library of readily available pre built functions
much like your brain/body has functions prebuilt to handle muscles.
3
u/WindowzExPee Apr 20 '25
If ur writing C apps for Windows then any of Charles Petzold's books are excellent for the Windows API
2
u/torotoro3 Apr 20 '25
I used the method of 2024 and it worked
2
u/[deleted] Apr 20 '25
I just started learning C this year too, and besides books I would recommend tasking yourself with projects that are small but doable with a challenges that force you to solve problems, or figure things out. Even if the code isn't as efficient as it could be the fact that you are writing your own code and solving problems on your own and learning to debug will provide so much value to you as a programmer.
2
u/EnvironmentalLook645 Apr 22 '25
AI generated post. Why flood the Internet with unoriginal garbage? Please delete this post mods
3
u/No-Sundae4382 Apr 19 '25
cs50 is a good beginners course, the c programming language is a great book, and after that I'd move onto making software with raylib:)
1
u/__bots__ Apr 19 '25
Go for the K&R C language programming. Try to solve all the exercises. Update your code to the actual standard
1
u/chef-p3s0s Apr 19 '25
C a complete beginners guide by Perry, I found it the most effective book on programming languages I’ve read
1
u/Fun_Potential_1046 Apr 19 '25
Write some ideas. And just do it.
My previous game Arcade (www.neopunk.xyz) was is C++. My next game (cubes) will be entirely ici C.
1
u/CreeperDrop Apr 19 '25
The C Programming Language by K&R. An absolute classic that will take you step by step. If may be a bit old but I think it is still a great launchpad for starters!
1
u/VArt21 Apr 19 '25 edited Apr 19 '25
For beginner would recommend the "All of Programming" by Andrew Hilton & Anne Bracy, 2024 edition, 777 pages. It teaches C and all that programming core "how". Get it at Google books some £15 U know this learning sequence: What > How > Why. The "why" aspect in learning is the last, is the roof of learning. U cannot build a roof without fundament "what", then walls "how", and only then roof "why".
1
u/Ariane_Two Apr 19 '25
Just google "C tutorial" and see for yourself which one is good. And maybe that does not even matter that much. Just start.
1
u/A_yman_ Apr 19 '25
You can check w3schools and also there is a for Claude Delaney ( Recommended by my professor)
1
u/miller_stale Apr 19 '25
What do you think of Head First C? Is that a good book you’d recommend to beginners too?
1
u/Strict_Barnacle7470 Apr 19 '25
This is not a c Tutorial but you can always use c to solve the projects but I highly recommend it.
Do from nand to Tetris both parts.
1
u/Kumlekar Apr 19 '25
You probably won't like hearing this much, but start with the "following along with random tutorials" or whatever. Most books mentioned will do that. After you have a basic proficiency in getting a command line program to do what you want it to, then move to a data structures book taught in the C or C++ language. For most programming the language used is nearly irrelevant these days. C is excellent because you'll learn concepts of how memory allocation and deallocation work up front, and you'll have less boiler plate code than many object oriented languages do. The concepts from higher level programming courses can be implemented in nearly any imperative programming language, so try to stick to the mindset that the language is the chosen tool to implement what you want. It's not the goal itself.
1
u/Gr3ymane_ Apr 20 '25
For a bit of humor along the way as the author wanted to be a fiction writer, if memory serves, but also was in love with tech and the C programming language itself: C all in One for Dummies by Dan Gookin. The book itself is quite dense and teaches you a lot with a few laughs along the way, which in my opinion is good for learning something new.
1
u/[deleted] Apr 20 '25
Don't fuck around. The white Bible is all you need.
1
u/denarced Apr 20 '25
Programming Pearls (Bentley) is a very nice ride for a beginner, to go through the basics in an interesting way. However, as already mentioned multiple times, the first book should be "C Programming Language". Then Programming Pearls is a good choice.
1
u/JupHut Apr 20 '25
I'd recommend Dive Into Systems
1
u/EchoAcceptable3041 Apr 20 '25
Hey..
I am in your position and while they say people learn in different ways, I think sharing in your ignorance of Programming might let me give some insight at least what I did and where I am.
The general idea and advice I notice is to use "The C programming language". I used this, and really, while I got a few things, I was stomped more often than not. It explains things and many times you really believe you have gotten it, but practicing some of the projects gets difficult. Also, while the text is concise, I think It can be a little too concise for someone who doesn't have any background knowledge.
You spend a considerable amount of time reading a supposedly short chapter. In my honest opinion, it dense and packed but I wasn't making progress like I thought or wanted.
Decided to check for another text and found K.N "C programming: A modern approach It is more wordy but I think it guides you in slowly and you are able to do things with the language one step after the other.
for someone trying to learn by themself, I think it holds your hands and guides you gently better than I found The C programming Language.
Take note: KNK c programming: a modern approach is more wordy than The C programming Language but with simpler language.
My suggestion: perhaps read 2 chapter In each, the first chapter for both and then a separate chapter covering different (introductory)concepts in both. That way you can see which feels more natural for you. first chapter to have a feel of how they both go into it and second chapter being different for both to remove the bias of the second being somewhat "easier" cos the first already primed you for the concepts.
Still can't make sense of a lot of things in programming but progress and gradually getting better is the goal, I hope it kinda aligns with what you mean to achieve too.
Goodluck buddy.
1
u/MinimumRip8400 Apr 20 '25
just do a lot of proyects
1
u/jwzumwalt Apr 22 '25
1
u/Sea_Goose9935 Apr 22 '25
my best thing is give it to you { go to understand the logic behind every program , then understand the syntax, algin the logic with that syntax } if you got any error, figure out it and fix it
1
u/Rick__001 Apr 22 '25
I used edub platform but I didn't complete, so maybe you find it useful.
1
u/MarsMao313 Apr 23 '25
I think OS lab help me a lot after I'm Familiar with the basic grammar.
1
u/M_e_l_v_i_n Apr 23 '25
Computer Systems: A programmers perspective Covers stuff like how hardware works, how numbers are represented(both twos complement and the IEEE 754 floating point standard are covered) how compiling and linking works, how memory works (how virtual memory sytem works as well), the OS services provided to user space processees, threads, how networks work roughly.
1
u/CodrSeven Apr 25 '25
I'll add my own (in progress) book, more focused on intermediate/advanced practical use though:
https://github.com/codr7/hacktical-c
1
u/allegrojm1079 Apr 25 '25
Look at:
Effective C: An Introduction to Professional C Programming 2nd edition by Dennis Molloy recently released. Check out the author's credentials.
1
u/[deleted] May 03 '25
Get Linux mint cinnamon
1
u/gundamMarketer Nov 25 '25
The C Programming Language was already brought up, but for a second book right after that "Modern C" is a good choice. Not sure if someone already said this, just throwing it out there.
0
u/Easy_Fig4046 Apr 19 '25
0
u/Cylian91460 Apr 20 '25
You try, I don't really recommend books on c
0
u/Dont_trust_royalmail Apr 20 '25
A lot going on with your question! Programming can be overwhelming at first..which is entirely understandable. What led you to choose C? I'm curious about what makes you think you'll be memorizing syntax.
You might want to reconsider this "is this the fundamentals? are there more foundational fundamentals? am I learning the wrong thing???" approach, and focus on doing... it's more about hours under your belt. And to develop a really solid understanding you must have deep experience with many languages. This takes a long time and requires patience. C isn't necessarily a bad choice for a first language but it isn't a good one either. Take your time, decide if you really want to learn programming, and if you do, get started in a small way and commit to doing it long term.
0
u/NeoProgrammer0911 Apr 20 '25
That's really good thought of starting programming with C. Because C hold very essential fundamentals for other programming languages. And for reference you go with. E Balagurusamy books they are very good for beginners they hold very easy approach to start from basics along with beginner friendly language. Hope you find it informative.
0
u/ghanashyam_ Apr 20 '25
Hi bro , I am a beginner in my coding journey, I have started from c programming . Pls suggest me anything. It will be helpfull❤️❤️
-5
u/DiverKey8714 Apr 19 '25
Let Us C ,By Yashavant kanetkar
-7
u/marco_has_cookies Apr 19 '25
Nah, no books, get your hands dirty.
-3
u/Xangker Apr 20 '25
Ask LLM specifically trained for programming, e.g. Claude, could answer your question better than most random people on the internet.
-7
u/Informal_Ad8599 Apr 20 '25
I would suggest that you take help from chatgpt to understand the why aspect of things
1
u/Laviran Apr 20 '25
I found head first c to be very engaging and fun
0
u/[deleted] Apr 20 '25
[deleted] — view deleted comment
0
u/[deleted] Apr 19 '25
[deleted] — view deleted comment