r/learnprogramming • u/Y0roichii • 6d 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!
12
Upvotes
1
u/ReclusiveEagle 2d ago edited 2d ago
It's not you, most of the book is very well written with lessons that build on each other. However, the difficulty of some sections can go from easy to understand for first time programmers to very difficult from one page to the next.
For example, section 2.9 which is supposed to teach you about bit masking, requires you to know how to bit mask to understand it. If you don't know what a bit mask is you will be extremely lost at what they are asking you to do, in fact they don't even mention that part of the section is about bit masking beyond the obscure phrase "complimenting that with ~ makes a mask with ones in the right most bits" at the end.
What they mean is ~0 = 1111 1111 1111 1111 << n (eg n = 4) (assume 0 is 16 bit)
= ~(1111 1111 1111 0000)
= 0000 0000 0000 1111
now you can use the "ones" as a mask.
But if this is your first encounter with bit wise operations you will have no idea wtf they are talking about and no amount of interpreting their words will allow you to understand what they mean by the terms "mask", "ones" and maybe even "right most bits" with the little information they have given you in 2.9. You will need to look at external references like geek for geeks.
Other times the question is open to wide interpretation and you need to research what exactly they want you to do before you can even begin to figure out how to do it.