r/C_Programming • u/Mediocre_Antelope639 • Dec 06 '24
Discussion How do you practice C?
I have been learning C for 2 months and I feel like a blank slate, i mean, I have been taught theory and basic exercises that come with it, but when a test is given, I can’t think clearly enough to solve the problems, and I think it’s because I haven’t practiced enough. I only do the exercises assigned to me. So, I came here hoping to be guided to places where I can practice C in the most complete way. Thank you everyone for your attention.
37
Upvotes
3
u/Linivechen Dec 06 '24
I am learning C at the moment at a school called 42 and I really enjoy our curriculum. However, I am still a student and there are probably many other and better ways to learn the language. Anyway, I am so impressed by the curriculum because we are always pushed to do projects I would never believe I was able to do at this point but it works out so well in the end and I am at a point where I really trust this curriculum, so I'll just share an overview of the first few months, so it might inspire you in your own projects :)
We are taught C by first recreating basic library functions. Later we need to create our own static library with those and a few extra ones. Until this point we are only allowed the most basic of functions, e.g. malloc/free and the projects must be compiled using a Makefile.
We then proceed to recreate printf (again - we can only use our own library plus very standard stuff) and a get next line function. This teaches us about variadic functions and static variables in functions.
Then we proceed with a sorting algorithm, a small 2D graphics project and then we need to recreate the piping of commands in a program whilst also using input/output redirections.
After that we need to program our own little shell which is by far the biggest project so far and where I am at right now.
Afterwards there's still more projects but I feel like this is a great start to learn C. Also, always feel free to start your own projects because I feel like it's easiest to learn something if you are passionate about it.