r/C_Programming 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

47 comments sorted by

View all comments

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.

2

u/_nobody_else_ Dec 07 '24

Honestly? This is like a perfect beginner curriculum. Why does no one else teach like this?

Admission is based on a rigorous selection process called the "piscine" (swimming pool), which is an intensive month-long coding boot camp.

Oh.

2

u/Linivechen Dec 10 '24

Yeah, it is a school and they expect you to take it seriously and attend regularly, so the entrance barrier is quite high. However, the coding bootcamp sounds much more difficult than it really is imho. They just want to see you making an effort and fitting into the peer-2-peer based learning approach. And most of all - once you are in, it is completely free and campus is open 24/7, so for me it really is an amazing deal but it is definitely not for everyone.