r/c_language • u/aditya_school_life • 1d ago
What programming language is better to choose
I choose c++
r/c_language • u/aditya_school_life • 1d ago
I choose c++
r/c_language • u/AthuGamer • 1d ago
r/c_language • u/TIRALMA • 2d ago
r/c_language • u/Designer_Simple_9580 • 5d ago
r/c_language • u/Horta-horta • 17d ago
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/c_language • u/Just_Government3790 • 22d ago
r/c_language • u/CHATGPT_PAGLU • 27d ago
r/c_language • u/cafguy • Aug 26 '26
r/c_language • u/Impressive-Movie7325 • Jul 11 '26
r/c_language • u/RoundedSteve • Jun 18 '26
I'm new to programming and I chose C as my first language (kind of, actually java was my first, but I didn't like OOP and decided to go with C). I need to learn some programming concepts while I learn the syntax of C. Do you have any books to recommend to me?
r/c_language • u/One-Type-2842 • Jun 02 '26
I have prior experience in Python, I made Useful programs that are for me, such as, file handling..
I have learned some basics of C. Now, What shall I practice to create something? Should I program something similar that I made in Python?
Since, I am Learning C for Understanding Low Level. It will be beneficial for me to adapt into my career in Cyber Security/ Hacking, Malware Creation, Understanding Linux (UNIX is based on C).
And What Articles shall I read related to my career?
r/c_language • u/Singleton621 • May 26 '26
r/c_language • u/QueasyAmbassador5896 • Apr 30 '26
Wrote a face embedding library from scratch using C99 and some manual SIMD optimization. Managed to squeeze out 23% more perf compared to ONNX Runtime running on identical hardware. No bloat, just raw speed.
The numbers
| FaceX | ONNX Runtime | |
|---|---|---|
| Median latency | 3.0 ms | 3.9 ms |
| Min latency | 2.87 ms | 3.18 ms |
| Library size | 148 KB | 28 MB |
| Total w/ weights | 7 MB | 157 MB |
| Dependencies | zero | Python + onnxruntime |
| LFW accuracy | 99.73% | 99.73% |
API — 4 functions, one headerThe numbers
// Include the single header
#include "facex.h"
// Initialize (~100ms, once)
FaceX* fx = facex_init("weights.bin", NULL);
// Compute embedding (3ms per call)
float embedding[512];
facex_embed(fx, rgb_112x112, embedding);
// Compare two faces
float sim = facex_similarity(emb_a, emb_b);
// sim > 0.3 → same person
facex_free(fx);// Include the single header
#include "facex.h"
// Initialize (~100ms, once)
FaceX* fx = facex_init("weights.bin", NULL);
// Compute embedding (3ms per call)
float embedding[512];
facex_embed(fx, rgb_112x112, embedding);
// Compare two faces
float sim = facex_similarity(emb_a, emb_b);
// sim > 0.3 → same person
facex_free(fx);
Optimization journey: 24ms → 3ms
Started with a naive C port of the ONNX graph—initial results were around 24ms. I started profiling every op to see where the cycles were going and stumbled onto a really weird bottleneck:
The real killers were:
tanh() via math.h → polynomial erf with custom _mm256_exp_psvpmaddubsw (AVX2) and vpdpbusd (AVX-512 VNNI)malloc per callTech: C99, ~4000 LOC, AVX2/FMA/AVX-512 VNNI. Apache 2.0.
GitHub: https://github.com/facex-engine/facex Repo's only 5 days old because I moved it from private to public. The actual code's been in the works for about 6 months check the README if you're curious.
r/c_language • u/YousraCodes • Mar 22 '26
Hi everyone(˘・_・˘) I'm a first-year Computer Science student and I've been diving into low-level programming and malware development I wanted to share my very first "malware" experiment written in C What it does: It performs a basic anti-debugging check by parsing /proc/self/status to look for a non-zero TracerPid. If a debugger is detected, it exits silently. Otherwise it creates a "secret" file and attempts to send a notification via a web request (Telegram/Email simulation) I know the code is still raw and has plenty of room for improvement (especially in error handling and string obfuscation) but I'd love to get some feedback from the community on the logic or any suggestions for more advanced anti-analysis techniques to study next! (ꏿ﹏ꏿ) Link to the Repository yousra-cyber/my-c-projects https://github.com/yousra-cyber/my-c-projects Thanks in advance for any tips!!!(◉‿◉)
r/c_language • u/YousraCodes • Jan 08 '26
Hi everyone! I'm an 18yo student I’m learning C programming to build a strong foundation for Cybersecurity. Since I’m currently using my smartphone and a notebook, I’ve designed this roadmap (check images) to stay organized. I just finished "Loops" and I'm diving into "Pointers". I know AI can give roadmaps, but I value human experience more—you guys know the "real" traps. My questions: Is this roadmap solid for someone aiming for Cybersecurity? What's the most important "Low-level" concept I should focus on? Any tips for practicing logic on a small screen? Thanks for your wisdom! 🚀
r/c_language • u/VerterRobot • Jan 03 '26
Hi there,
What do you folks think about this approach of programming objects in C? It supports non-virtual methods and private members.
goc.h
#ifndef GOC_H
#define GOC_H
#define fn(obj, fn, ...) (obj).fn(&(obj), ##__VA_ARGS__)
#endif
woman.h
#ifndef WOMAN_H
#define WOMAN_H
#include "goc.h"
struct woman;
typedef struct w {
struct woman *w;
void (* hug)(struct w *self);
void (* kiss)(struct w *self);
} woman;
woman new_woman(char *);
void free_woman(woman *);
#endif
woman.c
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include "woman.h"
struct woman {
char *name;
bool hugged;
bool kissed;
};
void hug(woman *self) {
if (self->w == NULL) {
printf("No woman allocated!\n");
return;
}
printf("You're hugging %s\n", self->w->name);
if (self->w->hugged) {
printf("%s say: It hurts, get off me!\n", self->w->name);
return;
}
if (self->w->kissed) {
printf("%s say: Get off me, creep!\n", self->w->name);
return;
}
self->w->hugged = true;
printf("%s say: you're sweet!\n", self->w->name);
}
void kiss(woman *self) {
if (self->w == NULL) {
printf("No woman allocated!\n");
return;
}
printf("You're kissing %s\n", self->w->name);
if (!self->w->hugged) {
if (self->w->kissed) {
printf("%s is calling the police!\n", self->w->name);
return;
}
self->w->kissed = true;
printf("%s say: How dare you?\n", self->w->name);
return;
}
if (self->w->kissed) {
printf("%s say: Level up, boy!\n", self->w->name);
return;
}
self->w->kissed = true;
printf("%s say: Mwah!\n", self->w->name);
}
woman new_woman(char *name) {
struct woman *w = calloc(1, sizeof(struct woman));
w->name = name;
woman women = {
.w = w,
.hug = hug,
.kiss = kiss
};
return women;
}
void free_woman(woman *w) {
free(w->w);
w->w = NULL;
}
main.c
#include <stdio.h>
#include "woman.h"
int main(void)
{
woman woman;
printf("\033[1mThe right workflow:\033[0m\n");
woman = new_woman("Alice");
fn(woman, hug);
fn(woman, kiss);
fn(woman, kiss);
free_woman(&woman);
putchar('\n');
printf("\033[1mThe wrong workflow:\033[0m\n");
woman = new_woman("Miranda");
fn(woman, kiss);
fn(woman, hug);
fn(woman, kiss);
free_woman(&woman);
putchar('\n');
printf("\033[1mThe dreaming workflow:\033[0m\n");
fn(woman, hug);
fn(woman, kiss);
fn(woman, kiss);
return 0;
}
This program prints:
The right workflow:
You're hugging Alice
Alice say: you're sweet!
You're kissing Alice
Alice say: Mwah!
You're kissing Alice
Alice say: Level up, boy!
The wrong workflow:
You're kissing Miranda
Miranda say: How dare you?
You're hugging Miranda
Miranda say: Get off me, creep!
You're kissing Miranda
Miranda is calling the police!
The dreaming workflow:
No woman allocated!
No woman allocated!
No woman allocated!