r/learnprogramming • • 19h ago

Learn C program language

Hi, I'm in university and I'm currently learning the C programming language.
I'm having a hard time understanding it properly, and I'd love some tips on how to learn it effectively.
Does anyone know of a website, video, or guide that is genuinely helpful to prepare for an upcoming exam?
Thanks!

9 Upvotes

13 comments sorted by

10

u/lurgi 19h ago

What textbook are you using? What parts of it are confusing you? There is no point explaining pointers to you if you are having difficulty understanding want int means.

Learning C is going to involve writing a lot of C. Are you writing lots of code whenever you come across a new concept?

CS50 from Harvard is a good course, but it teaches more than just C. learn-c.org has free courses.

1

u/owzleee 16h ago

Kerningham and Richie. It’s the only way.

1

u/Recycled5000 14h ago

K&R assumes you know programming, the process and address space, memory management, and just need to know how C works given that.

1

u/Stock_Test2326 7h ago

I think C Programming Modern Approach by K.N.King is good for starters

1

u/dyoqa6317 15h ago

i am using "C Programming A Modern Approach" but pointers are still confusing i

1

u/goqmo 15h ago

yeah, you gotta actually write the code or the concepts just float by CS50 8: solid but the writing part is what clicks it

2

u/Tony1Rice 12h ago

Get a copy of the K&R book, "The C Programming Language" (second edition, also sometimes known as "The New Testament") and go through it thoroughly. It's not a big book and you might be able to find an electronic copy on the internet. That will give you a good solid foundation from which to start. Then, I suspect the discussions, examples and exercises in the textbook, and the instructor's lectures, will make more sense.

Do note that there will likely be a bit of a gap between classroom work/textbook examples and an IRL programming task. Learning the syntax and even the nuances of a language is not the same as learning systems analysis and design and the programmer's mindset. In real life, a programmer is almost never just a "coder". One has to have an eye for what -can- be done and what -should- be done and -how- to implement solutions as programs. So much has to happen before the "programming" actually starts but, with experience, much of those preliminaries will -seem- like they just automatically happen - and that makes it look simple to the layman looking in from the outside.

1

u/YetMoreSpaceDust 17h ago

I still swear by K&R (Brian Kernighan and Dennis Ritchie's "C: The Programming Language") as the best reference for learning and understanding C. It's surprisingly short for the depth of information it contains.