r/cprogramming • • May 22 '25

Realizing what an API really is

1.3k Upvotes

Hey folks, just had a bit of an “aha” moment and thought I’d share here.

So for the longest time, I used to think APIs were just a web thing—like REST APIs, where you send a request to some server endpoint and get a JSON back. That was my understanding from building a few web apps and seeing “API” everywhere in that context.

But recently, I was working on a project in C, and in the documentation there was a section labeled “API functions.” These weren’t related to the web at all—just a bunch of functions defined in a library. At first, I didn’t get why they were calling it an API.

Now it finally clicks: any function or set of functions that receive requests and provide responses can be considered an API. It’s just a way for two components—two pieces of software—to communicate in a defined way. Doesn’t matter if it’s over HTTP or just a local function call in a compiled program.

So that “Application Programming Interface” term is pretty literal. You’re building an interface between applications or components, whether it’s through a URL or just through function calls in a compiled binary.

Just wanted to put this out there in case anyone else is in that early-learning stage and thought APIs were limited to web dev. Definitely wasn’t obvious to me until now!


r/cprogramming • • Feb 15 '24

They call me the 007 of C programming

684 Upvotes

0 best practices employed 0 free memory functions used 7 gigabytes of leaked memory


r/cprogramming • • Sep 13 '21

I made a game in C

621 Upvotes

r/cprogramming • • Feb 16 '26 This Bravo

Can we ban AI slop on this sub?

604 Upvotes

Out of the top 6 links right now, 4 are vibe coded slop by the same person.

Not only these things clutter the subreddit, but they also seem to be astroturfed.

I mean, who would upvote this? Can we just ban AI? Are there even any active mods here?


r/cprogramming • • Dec 31 '23

How do computers understand what we write in C or in any language?

471 Upvotes

I have a basic understanding that what we write gets compiled into machine code, etc. However, compilers are also written in some language. Who compiled the compiler? I know it may sound naive, but could someone please explain this process from the beginning?


r/cprogramming • • Jul 09 '21

When they say C is a dying language 😂

Post image
395 Upvotes

r/cprogramming • • Dec 17 '20

That's it !

Post image
244 Upvotes

r/cprogramming • • Oct 05 '25

Why language C is a base for programmers and a lot of them think that is the best language?

237 Upvotes

I recently started my studies at the university, majoring in Applied Informatics, and we were told that we need to learn the C programming language to understand how programming, databases, and computers in general work. When I started learning the language, I began hearing that C is the foundation of all foundations and that it provides the most valuable experience. I’d like to hear an expert opinion on this.


r/cprogramming • • Aug 17 '26

C Strings: A 50-Year Mistake

Thumbnail
longtran2904.substack.com
212 Upvotes

r/cprogramming • • Aug 04 '25

I've been an embedded engineer for 8 years now, and have never used malloc/free. Why has it not been a problem?

212 Upvotes

I've been an embedded engineer coding in C for 8 years now at a major company you 100% know. It's been long enough that I barely remember my coding classes (in truth I only had a minor in cs, I was more an engineer).

I keep seeing posts around reddit about how C programmers keep missing malloc/free calls and have big memory leaks. A lot of people complain about this being a hard part about C. Being curious, I checked my company's entire codebase, and there's not a single malloc/alloc/free call anywhere.

My question is why? Clearly this is working. There's no memory leaks. No one seems to care. What do those memory calls do, and how do they differ on a small embedded device?

I'm more an engineer that uses C as a tool to run some algorithms and output to registers, not a true programmer. I want to learn why it doesn't seem needed for me, but is needed elsewhere?


r/cprogramming • • Jun 19 '21

I did a image noise correction filter using the median filter technique and multiprocessing. All in C! Link to repo in the comments.

Post image
209 Upvotes

r/cprogramming • • Jan 05 '21

I hope so anyways

Post image
173 Upvotes

r/cprogramming • • Mar 26 '26

Build android Apps in pure C

148 Upvotes

I built a cross-platform GUI framework in C that targets Android, Linux, Windows, and even ESP32

So after way too many late nights, I finally have something I think is worth sharing.

I built a lightweight cross-platform GUI framework in C that lets you create apps for Android, Linux, Windows, and even ESP32 using the same codebase. The goal was to have something low-level, fast, and flexible without relying on heavy frameworks, while still being able to run on both desktop and embedded devices. It currently supports Vulkan, OpenGL/GLES and TFT_eSPI rendering, a custom widget system, and modular backends, and I’m working on improving performance and adding more features. Curious if this is something people would actually use or find useful.

https://binaryinktn.github.io/AromaUI/


r/cprogramming • • Sep 26 '26

I spent 7 years building a game engine using C

142 Upvotes

I've been working on a puzzle game for the last 7 years, and over time I ended up writing almost the entire technology stack myself.

The code is written in a C style, using a C++ compiler mainly because I like operator overloading for math. Other than that, I try to keep the code close to how I would write C. I don't use the standard library, exceptions, RTTI, RAII or object-oriented abstractions.

I made my own build system, UI library, in-game editor, Vulkan renderer, asset pipeline and most of the other tools I use to make the game.

There is no SDL or Dear ImGui. Most of the code is my own, along with a few small libraries such as stb_truetype and miniaudio.

I really like having direct control over all these parts of the codebase. If the game needs something new, I can change the renderer, tools, asset pipeline, build system or engine directly instead of working around an existing framework.

The game is a rule-discovery puzzle game, and building the technology behind it has been just as interesting to me as making the game itself.

The demo is now available on Steam if you want to see what I ended up making:

https://store.steampowered.com/app/5017320/Satelital_Demo/

The full game is planned for release later this year in November.

I'd be interested to hear how other people structure larger C projects, especially around memory management, build systems, UI and tools. I'm always interested in seeing how other people approach these problems.


r/cprogramming • • Aug 18 '26

I am open-sourcing csv.h a single-header CSV parser written in pure C99

138 Upvotes

For my thesis I had to read a lot of big CSV files in C and I couldn't really find a parser I wanted to use. The main C one is LGPL and comes with a whole build system, and everything else I found was C++. So I ended up writing my own. Now that im done with the thesis i cleaned it up properly , seperated it from the rest of the thesis code, and decided to standalone push it on GitHub.

It's one file. You copy csv.h into your project and that's it, nothing to link, no dependencies. It doesn't allocate memory, the fields just point into your own buffer, and you can run through files of any size a chunk at a time.

Honestly I spent way more time testing it than writing it. It passes csv-spectrum and I compared the output against Python's csv module on a few thousand files/

Check it out here -> https://github.com/GeorgeKiritsis/Csv.h

If someone has time to look at the API and tell me what could change or be imrpoved, that would help a lot. Thanks a lot in advance


r/cprogramming • • Nov 29 '25

z-libs - tiny single-header collection to write modern C (vec, list, map, string)

Thumbnail
github.com
136 Upvotes

So, I got tired of either writing buggy hand-rolled containers every time, or dragging in heavyweight dependencies just to get a decent string or hash table.

After this, I decided to throw together https://github.com/z-libs: four zero-dependency (for now), single-header, C11 libraries that focus on a pleasant DX.

The current libraries offer:

  • zvec.h -> growable vector (contiguous, swap-remove, built-in sort/search).

  • zstr.h -> proper UTF-8 string with 22-byte SSO, views, fmt, split, etc.

  • zlist.h -> doubly-linked list (non-intrusive, O(1) splice, safe iteration).

  • zmap.h -> open-addressing hash table (linear probing, cache-friendly).

Everything is type-safe, allocator-aware (you can use your own), MIT-licensed, works on GCC/Clang/MSVC and requires no build system.

The collection is still in process. Each week there will be updates. But I think the core suite is already mature enough.

I would love to hear some feedback!


r/cprogramming • • May 15 '21

Obfuscated mandelbrot program in C

131 Upvotes

r/cprogramming • • Apr 02 '21

"If it wasn't for C, we'd be writing programs in BASI, PASAL, and OBOL."

Thumbnail
twitter.com
131 Upvotes

r/cprogramming • • Jan 04 '25

Is this correct? coming from java

127 Upvotes

i just made my first hello world in C

#include <stdio.h>

#define public
#define static

typedef char* String;

public static void main(String args[])
{ 
    printf("Hello World!");
}

r/cprogramming • • 16d ago

A lot of you guys are chill

124 Upvotes

You guys are like the equivalent to the debian subreddit where a lot of the answers are either mature or funny.

There still some newbie posts out there I see or like the generic question yet Im amaze you guys still reply maturely.

Keep it up. No I'm not a programmer btw , I work in a hospital. I was browsing and I saw a lot of you where posting about making games outnof C and got curious.

I think games usually are made in C++ or C# I think.

Anyway, Im not a bot and keep up the kindness.


r/cprogramming • • Nov 14 '20

I really like C

122 Upvotes

I have several years of experience programming with C++, Python, and Java. I recently have had to program with C in the Unix environment (systems programming class). I REALLY like programming in C. I've been having to program functions from scratch that I've sort of taken for granted in higher level programming languages and their core libraries like Python and Java. My recent project required that I parse user inputed polynomials and perform operations on them. The dynamic memory management and making sure to deallocate pointers when finished with 2D arrays is pretty cool. Learning about the problems with C-strings and finding workarounds is also revealing and relevant to bug catching and patching. Programming with C has inspired me to also pursue assembly language.

That's all. No question, just appreciation. Thank you for indulging me.


r/cprogramming • • 7d ago

C isn't that scary or bad, it just neat

119 Upvotes

(First time using reddit so tell me if i'm doing something wrong :D)

I'm a new and honestly, a bad programmer, and ive always seen everywhere + i have been told that c is a "Scary" language and that it complex and all, it is very buggy, you have to manage everything by yourself etc...

But i wanted to try it, so i started building a SDL2 game with it, and i haven't encountered any big issues, it's the most powerful yet simplest (in some way) language ive used until now, it does what i want it to do, without black magic doing everything for me.

Legit i prefer using c to python, maybe i'm weird ? Gcc gives clever error messages, the syntax is fine, and it clicks well for me.

Does anyone know why c has this reputation of being a hard and scary language ? Maybe the fact you have to deal with pointers and memory ?


r/cprogramming • • Apr 27 '26

Been studying the original C compiler from 1972 by Ritchie.

115 Upvotes

Researching early Unix and low-level systems, and I ended up spending a good amount of time with this: the actual source of the first C compiler, written by Dennis Ritchie in 1972.
Everything we write today traces back to this. Worth reading if you haven't...
source: https://github.com/jserv/unix-v1/tree/master/src/c


r/cprogramming • • Jun 16 '25

"I know C..."; "Show me." What would you ask to someone if you wanted to make sure they master C?

114 Upvotes

What are the tell signs that someone truly masters C?
Writing/understanding which pieces of code?
Understanding very well the mechanics of concepts like pointers, or errors like undefined behavior or double free?
Theoretical stuff?
What would be a dead giveaway that they are rookies?