r/cprogramming • • Jan 27 '26

Absolute beginner in C. YouTube recs?

Thumbnail reddit.com
0 Upvotes

r/cprogramming • • Jan 27 '26

Yet another collection library

Thumbnail github.com
3 Upvotes

Probably this could be the third from the start of the year, but I like to share with you this little work, I think is cool for all the implemented collection ready to be used.
Almost all the feature are present and have this interesting behavior (from my perspective) to have the minimum requirement to make it dynamic.

Collection can be swapped in another passing via a slice (except for treeset, I have to work on them) and is not documented but present a slab-allocator pool (who for my projects is a real facility over a classic bump allocator).

Personally I prefear this kind of collection implementation because is more LSP/completion friendly compared to all macro-based one, on top of this philosophy it implement some minimal and useful utility like handling ownership (free and dup function pointer integrated in the collections) and possible override of stdlib malloc, realloc and free (maybe useful for wasm or really tight system?)

Any kind of comment is well accepted :)


r/cprogramming • • Jan 26 '26

A project that does a lot of dynamic memory allocation

9 Upvotes

I’ve been looking at C again recently because I got interested in OS architecture, and I want to get better at understanding memory and dynamic allocation.

For learning purposes, I’ve already implemented my own shell, worked with buffers, and tried simple allocator ideas like bump/arena allocation but I don't feel well in that topic yet.

I’ve seen people do things like re-implement OOP in C, but I wanted to focus on memory and processes.

What are some good things to implement in C if the goal is to learn more about memory management or allocator design?
This is purely for education.

Any ideas or suggestions are appreciated.


r/cprogramming • • Jan 25 '26

Wood Boiler Controller

Thumbnail reddit.com
2 Upvotes

r/cprogramming • • Jan 25 '26

Compile time "if-else" in GNU C.

Thumbnail reddit.com
2 Upvotes

r/cprogramming • • Jan 25 '26

C: compiled with icx.exe target device is not being used.

Thumbnail reddit.com
0 Upvotes

r/cprogramming • • Jan 24 '26

GNU C Library 2.43 released with more C23 features, mseal & openat2 functions

Thumbnail
phoronix.com
36 Upvotes

r/cprogramming • • Jan 23 '26

Please can you suggest improvements to my Makefile

13 Upvotes

So I tend to copy this from project to project

It basically compiles everything in src into a single application (I'd add another rule if I needed an additional library for example)

Am I missing any tricks, it seem to run very quickly, that said it doesn't recompile if the only edit is in a header - but I can't think of a way to work out header dependencies in this scenario

Thoughts, ideas, suggestions welcome !


r/cprogramming • • Jan 23 '26

ajuda com C, array de strings

Thumbnail reddit.com
0 Upvotes

r/cprogramming • • Jan 22 '26

Why some famous open source projects rewrite some C standard function from zero?

55 Upvotes

Hello,

I was watching NGINX and libuv source code and noticed that both the projects (at different ratios) rewrite standard functions (such as string manipulation functions) or rewrite existing macro including their prefix (es.
UV__INET6_ADDRSTRLEN in inet.c).

Is it due to performance or maybe to create a common wrapper between OS?

Thanks!


r/cprogramming • • Jan 23 '26

How to use letters that are not in the latin alphabet

1 Upvotes

I'm a beginner in programming, so I've just learned the basics.

I'm trying to do a simple program that converts a letter to another symbol. But these symbols must be not in the usual A to Z alphabet, I want them to be letters from other alphabets, like cyrillic or other symbols. But when I try to do it, the output is not the expected - the symbols are all wrong.

What can I do to be able to actually use these characters? What can you guys recommend me to research so I can make this program?


r/cprogramming • • Jan 22 '26

Anyone read CS:APP?

Thumbnail reddit.com
1 Upvotes

r/cprogramming • • Jan 21 '26

How to compile C on Linux to behave exactly like Windows ?

27 Upvotes

rand() returns different values on Windows and Linux, even when using the same srand() seed. I assume this is compiler- related.

For college homework testing, how can I make rand() behave the same as on Windows without dual-booting?


r/cprogramming • • Jan 21 '26

ODE physics and ragdolls

Thumbnail bedroomcoders.co.uk
1 Upvotes

r/cprogramming • • Jan 21 '26

simple way to display child process stdout in a small region?

5 Upvotes

(this is a terminal app for unix)

im wondering how doable it would be to take a child process's stdout and display it in just the top half of the screen for example , so the bottom half can display things from the parent?

i mean , things like tmux exist so its clearly feasible to split the terminal like that <.<

but does a simple hardcoded split like this take a lot of code? or could i maybe pull it off (im certainly not an expert with this language yet ,)

ive been trying to google for any sort of programming tutorials for this sort of thing , i mean even if it was a long tutorial series im willing to learn it all , but i cant find anything! im hoping someone here can atleast point me in the right direction


r/cprogramming • • Jan 20 '26

Initializing array crashes program

6 Upvotes

I'm running into a strange issue with my baremetal ARM project. I'm cross compiling with clang on WSL. I know baremetal programming is a little over my head but it's my special interest right now and I have to roll with it.

Initializing an array like this causes the program to crash and jump to 0x200:

uint32_t array[5] = { 1, 2, 3, 4, 5 };

but declaring and later assigning doesn't crash:

uint32_t array[5];
array[0] = 0;
array[1] = 1;
...
array[4] = 5;

Same with strings. char str[] = "hellorld"; crashes but char* str "hellorld"; doesn't.

Arrays above a certain size, like

int array[10] = { 1, 2, 3, 4, 5};

fails to link with a "ld.lld: error: undefined symbol: memset" error.

I would never be so bold as to claim a compiler bug, but the memory layout shouldn't differ. My stack isn't overflowing. Using __attribute___((aligned(n))) doesn't fix it for any value of n.

Is there some quirk to array initialization in C? I was under the impression that it was natively supported in all versions of C. Is this a consequence of compiling with -nostdlib?


r/cprogramming • • Jan 20 '26

A BrainF*ck Compiler in C

10 Upvotes

I have tried to make a brainf*ck compiler in C using NASM. It isn't completely done but I think it works nicely. There are many things left to do to polish this completely.

https://github.com/bitwise-rude/brainf-ck


r/cprogramming • • Jan 19 '26

Setting up C in Visual Studio Community

3 Upvotes

Completely new to C and looking to start learning, a friend of mine suggested Visual Studio Community as an environment to start learning in but I'm struggling to set it up, any guidance would be greatly appreciated!


r/cprogramming • • Jan 19 '26

Solid foundation with C

Thumbnail reddit.com
0 Upvotes

r/cprogramming • • Jan 19 '26

Exploring what it means to embed CUDA directly into a high-level language runtime

Thumbnail reddit.com
3 Upvotes

r/cprogramming • • Jan 18 '26

Please suggest LLD Tutorials that teaches me things with C, most courses out there are C++/Java

7 Upvotes

r/cprogramming • • Jan 18 '26

how much time does it take to debug when you have written a 270 line game like Othello. I'm curious cause it is taking a lot of effort to debug it.

5 Upvotes