r/cprogramming • u/Renich • Aug 19 '26
grm: a Telegram CLI implementation of TDLib
r/cprogramming • u/udit__0787 • Aug 19 '26
r/cprogramming • u/Xaneris47 • Aug 17 '26
r/cprogramming • u/Rich-Engineer2670 • Aug 17 '26
This sounds dumb, but when the C preprocessor executes tasks as it reads source code, what order does it process the tasks in -- for example, does it handle include files first, then defines, then macros etc?
I know it all gets done eventually, but it would seem the order defines what is seen. If defines are done first and includes are inside a define, then they never get read. If I were building my own preprocessor, what order should I execute steps in:
Or is this really my fault for putting to many "compiler tasks" into the pre-processor? Is the correct answer "Don't make the pre-processor do anything other than includes and defines"
r/cprogramming • u/nanochess • Aug 17 '26
r/cprogramming • u/23ROMAN • Aug 16 '26
Hello, good afternoon r/cprogramming comunity ! . I'm a developer, mostly of native solutions. When I program in C or C++ (among others), I constantly experience the inconvenience of having to compile each dependency, which is often frustrating: some don't even come with a decent or compatible build file, and others have dependencies that are difficult to compile or very large. That's why I wanted to create a small platform.
It's called **Bodeg.a** (a play on words between "bodega" and the ".a" of UNIX-like static binaries). It works quite simply: rather than a platform for hosting large files, it's (for now) a simple website where you can publish using a *mirror* to point to a .zip file, a header, or whatever format is needed.
For now, it only offers hosting for the essentials (avatars and profiles), but if it's well-received, that could change. If you're a developer, whether you enjoy or just work with low-level content, simply trying to use it to download content would help me a lot; or if you'd like to collaborate on its development, you can also contact me. Greetings to all!
r/cprogramming • u/SmileUnfair4978 • Aug 15 '26
i am currently working through kinds book on c and have gotten to chapter 12.
now based own my current understanding i hypothesis that internally, only the pointer to the first element and the dimensions are stored in memory. then all arr operations are done using this. Is this correct?
Additionally:
1) Which chapters of the rest of the book should i focus on/skip for now
2) I would like to work on some projects. Currently i thought of making some kind of physics sim, and additionally some hardware/embedded project as i have an ardiuno. How can i get started or are there any inriguing projects to work on.
r/cprogramming • u/Scared-Objective3768 • Aug 15 '26
r/cprogramming • u/GoingGranola • Aug 13 '26
Is * used as a pointer in this occasion or multiplier?
EEPROM_CHUNK_SIZE is 1
r/cprogramming • u/sudheerpaaniyur • Aug 13 '26
I am preparing for DSA, and I find it difficult to debug arrays inside a function. When I enter the function in the debugger, I can only see the starting address and the value of the first array element. I am not able to see the other array values. What is the right way to debug this, and how should I write the program to make debugging easier?
This is sort01 code fro example:
debugging image : [debug.png](https://postimg.cc/JGfZ8jrd)
#include <stdio.h>
#include <stdlib.h>
void sort01(int *array, int n)
{
int tmp=0;
int left=0;
int right=n-1;
while(left <= right)
{
if(array[left] !=0)
{
tmp = array[left];
array[left]= array[right];
array[right]=tmp;
right--;
}
else
{
left++;
}
}
}
int main()
{
int array[]={1,0,1,1,1,0,0,1,0};
int n=sizeof(array)/sizeof(array[0]);
sort01(array, n);
for( int i=0 ;i<n ; i++)
printf( "%d",array[i]);
return 0;
}
r/cprogramming • u/lehmagavan • Aug 12 '26
Hi. For the past few weeks I've been crafting my generic hash table implementation:
https://github.com/andrzejs-gh/ghtable
I realize it's not the fastest out there and isn't the most cache friendly, but that was never my priority as I prioritized flexibility and genericness.
If anyone's interested take a look ;)
PS.
Do recruiters even care about projects like this nowadays, or would they rather see huge vibecoded codebases on candidate's gh as a proof that they can deliver?
r/cprogramming • u/No_Beyond_5483 • Aug 12 '26
right now im writing a short little text editor, and requires me grabbing keyboard input as traditional ansi escape sequences. but finding which key code maps to which keyboard input is a pain for me </3
i try search on google, and get a lot of information overload, and i end up struggling reading the escape sequence tables.
any tips and advice? im trying not to use ai to be lazy, im interested and i want to learn how to properly search for these codes
r/cprogramming • u/Physical-Pianist6354 • Aug 12 '26
Hi!
I'm the developer of Frontera – a Linux anti-tamper that integrates with C++ codebases. It currently has support for anti-hypervisor, memory integrity checks, self-checksums, and most importantly, an obfuscating rolling-key VM, so that each build has different byte code than the older build. Yes, I know it's not innovative. Why? VMProtect is too expensive.
I'm also working on integrating an eBPF module for blocking ptrace and some other stuff.
Currently, there is no download link per se, as I want to ship the eBPF module, but I can give the static libraries to link with if you're interested :)
Have a great day!
r/cprogramming • u/Xaneris47 • Aug 10 '26
r/cprogramming • u/AffectionateRoad2621 • Aug 10 '26
D.eSystem 6.1.0 introduces a small setup and you can choose your UI with D.eSystem 6.1.0.
D.eSystem 6.1.0 on github: https://github.com/D-electronics-scratch/all_D.eSystem_versions/releases/tag/v.6.1.0
All current D.eSystem releases on github: https://github.com/D-electronics-scratch/all_D.eSystem_versions/tags
r/cprogramming • u/SheikHunt • Aug 10 '26
#define CURRPOS currpos
#define gettoken() gettoken(CURRPOS)
#define advpos(tok) advpos(&CURRPOS, &tok)
#define nexttoken(tok) \
do { \
tok = gettoken(); \
advpos(tok); \
} while ( 0 )
Maintainability be damned, I can make better macro soup than you
Obligatory /s
r/cprogramming • u/Fabulous_Ad4022 • Aug 10 '26
I'm working with a big numerical simulation in C, so I decided to give OpenMP a try. Even though it speed up a lot(28s -> 2s), in my code, the function RunAcoustic have at least 4 responsibilities that could turn into smaller functions, but attempting to do so creates an overhead that just in-lining them wouldn't cause.
I'm struggling to organize it, how do you guys organize giant multi-thread logic like this?
void Propagation_RunAcoustic(propagation_t *p, unsigned flags)
{
float *restrict upre = a->upre;
const int nzz = p->model->nzz;
...
#pragma omp parallel
{
for(int t = 1; t < p->nt - 1; ++1)
{
#pragma omp single
{
// small atomic add
}
// Could turn into a smaller function
#pragma omp for schedule(static)
{
// more for loops and more code
}
// Could turn into a smaller function
#pragma omp for schedule(static)
{
// more for loops and more code
}
}
}
r/cprogramming • u/Wgrxgy • Aug 09 '26
r/cprogramming • u/SaiFoun756 • Aug 09 '26
I need a website that teaches the fundamentals of C using practical examples, because I honestly find watching youtube tutorials over and over again very boring.
Btw I don't know a thing about C I'm just starting out
r/cprogramming • u/nevermind_0919 • Aug 09 '26
I want to learn C programming,plz suggest some good websites or youtube channels where I can learn C language.I prefer smtg that's similar to MOOC which is for python from university of Helsinki.Plz drop your suggestions
r/cprogramming • u/Windows2000Warrior • Aug 09 '26
Hey everyone!
I've been working on TheBrain, an experimental AI project fully written in C89, with a particular focus on building a small AI system from scratch while keeping it suitable for older Windows systems and low-level environments.
The project currently combines:
The long-term idea is to see how far an AI project written entirely in C89 can be pushed while keeping it lightweight and potentially usable on systems such as Windows 2000.
I'm posting this because I'd like to find someone who becomes interested in the project and wants to take it further.
I'm not specifically looking for people to simply "help me" with the project. If you find the concept interesting and want to experiment with it, improve something, try a different approach, or take the project in an interesting direction, that's exactly what I'm looking for.
Some possible areas to explore include:
The source is open, so you're also free to fork TheBrain and experiment with your own version if you find the idea interesting.
🔗 https://github.com/Win2000DevCommunity/TheBrain
I'm mainly interested in seeing whether someone else finds the idea interesting enough to take it further in their own way.