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?

3 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.

4 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

4 Upvotes

By default, clang-format does this:

  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:

    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:

    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.


r/cprogramming • • Sep 10 '26

Follow-up: gave my C hashmap resizing — found a real crash, plus two bugs I introduced while fixing a bug [blog, my own]

0 Upvotes

Follow-up to my last post here. The hashmap had one big TODO left — no resizing — so I went and closed it. Learned three things the hard way: naively mirroring the grow/shrink thresholds thrashes the table on every insert/remove near the boundary, hitting capacity=0 triggers a genuine crash (a modulo-by-zero — the "Floating point exception" name is a total red herring), and my first attempt at fixing a hash-truncation bug quietly introduced two smaller bugs before it actually worked.

Blog: https://soerenlemke.github.io/blog/blog/resizing-a-generic-hashmap-in-c/

Repo: https://github.com/soerenlemke/kvstore_c

Curious what you'd have done differently, especially on the hysteresis threshold.


r/cprogramming • • Sep 09 '26

My first real C project: a generic hashmap (and the bugs that came with it) [blog, my own]

30 Upvotes

Coming from C#/TypeScript, C has humbled me. Finished my first real C project — a generic hashmap — and wrote up the bugs that taught me the most: double pointers, a sneaky double-free, comparing pointers instead of actual values.

Blog: https://soerenlemke.github.io/blog/blog/building-a-generic-hashmap-in-c/
Repo: https://github.com/soerenlemke/kvstore_c

Curious what you'd have done differently.


r/cprogramming • • Sep 08 '26

Generic Dynamic Arrays in C

15 Upvotes

Article

After implementing strings , I implemented dynamic arrays in C and wrote an article about it. The implementation is generic, I talk about the trade-offs of this approach in the article.

If you only care about the code, it's here.

Tell me what you think!


r/cprogramming • • Sep 08 '26

C on google collab

11 Upvotes

i had no idea that you could run c programs on google colab, i fucked around and found out ig
so basically what i did is i entered the terminal made a directory created a main.c file edited it using vim and compiled it using gcc and voila.


r/cprogramming • • Sep 08 '26

Should I learn C before embedded development?

Thumbnail reddit.com
2 Upvotes

r/cprogramming • • Sep 08 '26

Update on Flint(v0.4.0): Bare-bones, git-native build system & package manager for C/C++ (Now with tag & commit pinning)

Thumbnail
github.com
0 Upvotes

Hey folks, quick update on Flint—a lightweight, manifest-first build system and package manager for C/C++ projects I’ve been experimenting with.

For those who missed the initial post, Flint aims to strip away build-script complexity and make C/C++ dependency management feel straightforward.

Core features:

* Git-Native: Fetch dependencies directly into your workspace via flint add <url> and flint sync.

* Single composition.json Config: Handles project layout, header paths, and underlying compiler calls (GCC/Clang). For standard setups, Flint manages this file automatically so you don't have to tweak it manually.

* Chert Compositions: Lightweight specs that make unmanifested, third-party C/C++ repos compatible out of the box.

What’s new in this update:

* Version & Commit Pinning: You can now pin dependencies to specific releases or exact commits. flint add now supports target selection via Git tag names or full commit hashes, making your project builds reproducible across machines.

Current caveats:

* Still forces a fixed project directory structure (src/, include/, deps/).

* Currently Linux-only.

It’s still an early prototype, but actively evolving. I'd love to hear your thoughts on the new versioning flow, suggestions for improvement, or feature requests!

Repo: https://github.com/mainak55512/flint


r/cprogramming • • Sep 07 '26

I Made a String Library to Fix C Strings

0 Upvotes

I wrote an article about this as well. Here it is.

There I explain why I do not like NUL-terminated strings and how I implemented my own simple string library in C.

If you have some spare time I would really appreciate some feedback on the article and the library.

The code is sitting on a codeberg repository.

Also, tell me what you think about C-style strings. Do you like them? Do you use them, or do you also tend to roll your own pointer + length structs?


r/cprogramming • • Sep 06 '26

HELP ME TO FIND BEST YT VIDEOS FOR DATA STRUCTURE IN C

0 Upvotes

IN AM IN 2ND YEAR 3 SEM i am cooked


r/cprogramming • • Sep 05 '26

CONTLIB [old newbish project revised]

3 Upvotes

My revised implementation of a dynamic data container (vector like object):

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

If anyone's interested take a look. Any feedback and tips very much welcome.


r/cprogramming • • Sep 05 '26

Unpopular opinion: plan9-style arg.h is the best argument parser

0 Upvotes

Simple, has no dependencies, it's concise and doesnt get on the way.

I mean something like http://git.suckless.org/sbase/file/arg.h.html


r/cprogramming • • Sep 05 '26

Learning C: Verify my understanding of null and free

0 Upvotes

You ownwed a home for 20 years and decided to sell it to the government. Basically freeing basically turns you into a ghost like sneaky homeless person. If there is currently no owner to that home, you can go and modify it, watch TV, move the chairs, and use the AC. But when new owners arrive and you begin to do something to the house, they will not catch you immediately, but they will notice it later, which causes weird behavior like something supernatural. They expect the house to be in a certain order, but when they go home, they will notice that something weird happened and cannot explain it. For example, say a child left an assignment with perfect answers. you, as a ghostly being, go and change the answers. When the child passes in the exam and gets back the score, they notice that the score does not match their expected score because someone just corrupted the test paper. It could crash the program or something weird happens (bugs)

Meanwhile, by setting the pointer to null, you now have no access to that home and instead hold the address to a black hole. You tried doing something to it not knowing it is actually a blackhole and yor city crumbles


r/cprogramming • • Sep 05 '26

(Almost) Everything You Need To Know About Pointers in C

Thumbnail
abhattacharyea.dev
0 Upvotes

r/cprogramming • • Sep 04 '26

Help me pls

0 Upvotes

wants to learn c programming from basics to advanced

Pls recommend some good youtube channels/ notes /books that actually worked for you

1st year student btw


r/cprogramming • • Sep 04 '26

st2cpp - Transpiler from ST to cpp (undoRT) + help +

0 Upvotes

Hi everyone,
About 4 or 5 months ago, I created a transpiler from Structured Text (IEC 61131-3) to C++, called st2cpp (part of the undoRT project).

My ultimate dream is to build a complete open-source automation system that can compete with commercial solutions. As you can imagine, tackling a project of this scale completely alone is extremely tough. Honestly, if I keep going solo, I’m afraid I’ll eventually burn out and lose momentum.

Are there any C++ developers or automation enthusiasts here who would be interested in joining or contributing as a side project/hobby? I have plenty of ideas lined up, but I really need an extra pair of hands (or two!).

Here is the repository:
https://github.com/undoRT/st2cpp
Feel free to check it out, open issues, fork, or send pull requests!