C boilerplate

Posted on 1 Jun 2026, 16:23

I'm currently following CS50 course. Along the course, I have exercises to do. They suggest to use their online platform, but I wanted to do the exercises and running on my machine.

Over the past weeks I've been doing quite basic yet interesting things in C. For each exercise, I would create my .c file and update my Makefile each time I would add a new project. It was quite tiresome.

But this week lecture was about pointers and file I/O. It gave me an idea. All the Makefile modifications are the same for each new project, and they all start from the same .c file. So why not make some boilerplate, and then use them to generate the folder, Makefile and .c file according to the name passed to the generator command ?

Well, I did it today, and you can find it here, along with the code I wrote for each exercise.

If you have any comments or remarks, you can reach out to me.

PS: I should see how to include properly libraries in my code. I don't really like having bstrlib.h and bstrlib.c in the root folder of my repo.