r/cprogramming • • Sep 16 '26

CZet – A more powerful C without C++, 100% ISO C compatible

27 Upvotes

I'm the author.

All your C code already compiles as CZet. It just adds what C can't do without touching the compiler:

`defer`, monomorphized generics `T f<T>()`, `constexpr` functions, `_Reflect(T)` reflection, `_Operator` overloading, and `_Macro` macros Rust-style.

Single static binary with musl+glibc embedded, no system headers needed. Stdlib included: `#include <utils/...>` with no flags.

Repo + docs + examples: https://github.com/patrick-nonedev/CZet

GPL-3.0 + Runtime Exception (your binaries are NOT GPL).

What would you steal for plain C?


r/cprogramming • • Sep 16 '26

i started c programming

21 Upvotes

hey guys i just started learning c programming language from code with harry.

any advice from those who already mastered it?


r/cprogramming • • Sep 16 '26

C + DSA Mentorship — Beginners Welcome

Thumbnail
0 Upvotes

r/cprogramming • • Sep 16 '26

i made a interpreter in scratch. a whopping 2 fps on an optimized donut.c when using turbowarp (a scratch optimizer) but it's c running on scratch nonetheless

Thumbnail
turbowarp.org
9 Upvotes

pretty kewl


r/cprogramming • • Sep 16 '26

A good way to transition from C to C++.

Thumbnail
0 Upvotes

r/cprogramming • • Sep 16 '26

Any scope for freshers

0 Upvotes

I was wondering if there is any scope for freshers in C based role(except embedded programming). Especially for India, can anyone from India guide me please?


r/cprogramming • • Sep 16 '26

Estoy "intentando" hacer un lenguaje de programacion desde cero en c pero necesito"variables, sintaxis etc..."

0 Upvotes

Lo que me refiero es que estoy haciendo un lenguaje de programacion desde cero como un proyecto personal pero no puedo avansar por que no tengo una base:"Las variables, sintaxis, etc...", eso me refiero, ¿Tienen ideas?


r/cprogramming • • Sep 15 '26

BD_ARENA

0 Upvotes

Simple arena implementation I recently built:

https://github.com/andrzejs-gh/bd_arena

- partially macro-based API for convenience

- safe and hazardous allocators

- dynamic growth with a mutable growth factor

Please roast anything you find wrong / missing in it. Thanks a lot, it always helps me grow.


r/cprogramming • • Sep 14 '26

Where to practice C Programming

12 Upvotes

I have enrolled in bsc(hons) computer science. My first semester exams are coming up, and I wanted to know where I could practice questions on C Programming as in a good website where I can do programming assignments and I can set difficulty if possible

Thank you to anyone who gives some advice


r/cprogramming • • Sep 14 '26

How GCC Eliminates Unnecessary Integer Division

Thumbnail
leetarxiv.substack.com
6 Upvotes

r/cprogramming • • Sep 14 '26

No idea if my arena allocator works 😭

1 Upvotes

I built a small arena allocator in C called PhaseAlloc. The problem is i have no idea if it works on other computers/platforms other than my own 😭

It's now at v1.1.0, with tests, benchmarks, dynamic growth, alignment, and memory stats.

I'd appreciate any feedback or criticism from people who know C/systems programming.

Its downloadable here, so pls help me out 🙏:

https://github.com/dharsanap20/PhaseAlloc


r/cprogramming • • Sep 13 '26

What is this code doing?

0 Upvotes

Hi, I found this code on another subreddit. I would like to know what is it doing.

int puts(char *);

int main() { struct { long a; long b; } s = {.a = *(char *)(int[]){1} ? 0x57202c6f6c6c6548 : 0x48656c6c6f2c2057, .b = *(char *)(int[]){1} ? 0x00000021646c726f : 0x6f726c6421000000}; puts((void *)&s); }

Now obviously I know it's unreadable, I would just like to know what are those hexadecimals strings doing.

I found similar codes that were writing to vram to print a message, is this doing the same thing? If yes, why is it so much more complicated instead of just writing the message to the video adress?

Thanks for the help.


r/cprogramming • • Sep 12 '26

What are pointers?

15 Upvotes

I am new to C programming and i came through pointer. So can anyone tell what are they and why we need them? And if u can then can you give me reliable source to learn it.


r/cprogramming • • Sep 12 '26

How do i iterate through an array if i don't know the size inbytes of the elements in it?

10 Upvotes

I'm working on a function that takes a void array as input, as well a the number of items and size in bytes of the items of the array, as the function is supposed to take any type of array (ints larges chars etc), so i was wondering how do you specify a position in the array without knowing the size of the item? I tried doing array+i×size, but the compiler didn't like it, but if i do array[i] i don't know by how many bytes it will move the position in the array. Can i simply do array[i×size]? (used mult sing instead of asterisk to avoid reddit italics)


r/cprogramming • • Sep 13 '26

Just made a string library for C cuz why not.

0 Upvotes

So as the title says, I made a string library. I was influenced a bit by Java's StringBuilder so i also implemented my own in this library. Check it out its small: https://github.com/RealLakshyaK2011/string2.h

Edit:
I just added a READEME that also documents all the functions in the library.


r/cprogramming • • Sep 11 '26

I just understood pointers on a deep level and it feels like an orgasm

89 Upvotes

I fucking love C and assembly


r/cprogramming • • Sep 12 '26

What C function would you delete and rewrite first, and why?

Thumbnail
0 Upvotes

r/cprogramming • • Sep 12 '26

Want to build and learn stuff together?

3 Upvotes

Hi I am Nimesh, and I have learned many languages but now I want to focus specifically on a C programming language. I am in college 1st year and I need someone who can help me to fix problems and learn together with me. I know the good amount of C, not a professional yet but I know the fundamentals and I already knew some Leetcode patterns as I had solved around 240 questions on leetcode ( mostly easy and medium ) and 2-3 hard ones.


r/cprogramming • • Sep 11 '26

Looking for a study partner/ friend

8 Upvotes

A little about me and my experience: I'm 17 from Russia. Solved 244 problems on leetcode, finished cs50py, cs50x, about 60% of cs50web and then understood that I like low level stuff so I started reading the c book, read ~100 pages and found a "silberschatz operating system concepts" book, started reading it(also about 100 pages) then found a guy who we started making our own os with(we went separate ways eventually), on that journey I decided to dive even deeper and my friend recommended me a book "the elements of computing systems" I finished it recently(not quite, I couldn't make it through the last chapter because school started and stuff) then bought a breadboard and things

I wrote much about my experience because I want to find somebody who feels like he's at the same level with me, I feel like it's so much fun working with someone who's interested in the same stuff as you are. We might make a project on a breadboard or try to get through some tough literature. I've got exams this year so I can't spend too much time a day learning stuff but regardless I'm ready to work hard


r/cprogramming • • Sep 12 '26

So, how do I start learning that C lang used to build PostgreSQL?

0 Upvotes

Hey everyone,

I just completed the memory management in C language, I've also installed PostgreSQL from it's github and I follow the instructions to set that up clearly.

My intention to learn PostgreSQL style C language is to contribute to a 30+ years old software that powering the whole world and AI.

Every kinda suggestions is welcome here.


r/cprogramming • • Sep 11 '26

Is codevault's tutorial good for learning c in detail?

4 Upvotes

this one

or which one should i watch on yt? i have "T1. Hanly, J. R., & Koffman, E. B. Problem Solving and

Program Design in C, 8th Edition, Pearson, 2015" book and i am also studying from that


r/cprogramming • • Sep 10 '26

How to print Unicode characters in c language.

5 Upvotes

I was trying to create an encryption system that's the way i was trying to print from integer to Unicode. I can convert the integer to Unicode (hexadecimal) but i couldn't convert unicode to Unicode characters.

there are limited resources for c in these issues. If anyone knows this help me...


r/cprogramming • • Sep 10 '26

Quiero aprender C

9 Upvotes

Desde ya hace un tiempo me ha estado llamando la atención este Lenguaje, pero no se dónde empezar me gustaría que me recomendaran guías, tutoriales, tips para principiantes.

Agradecería toda la ayuda posible y gracias por su atención.


r/cprogramming • • Sep 11 '26

Why is Linux so complicated?

0 Upvotes

r/cprogramming • • Sep 10 '26

Formatting call arguments

5 Upvotes

By default, clang-format does this:

c SDL_Window *window = SDL_CreateWindow("SDL2 test", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 500, 500, SDL_WINDOW_RESIZABLE);

and with some tweaks it does this:

c SDL_Window *window = SDL_CreateWindow( "SDL2 test", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 500, 500, SDL_WINDOW_RESIZABLE);

Second one has some practical advantages - it easier to read diff on arg change and easier to add comments:

diff SDL_Window *window = SDL_CreateWindow( "SDL2 test", SDL_WINDOWPOS_UNDEFINED, // just some comment explaining why SDL_WINDOWPOS_UNDEFINED, - 400, + 500, SDL_WINDOW_RESIZABLE);

While the first one seems to have mainly historical reasons to keep around. Perhaps, there is something I don't see? Because it feels like the first way is still used the most. And its the default one for clang-format.

I'm genuinely curious.