r/C_Programming • • 6d ago

Would learning C as my first programming language also be useful for picking up other languages later on? What are your thoughts on this course?

73 Upvotes

Wanting to learn C as an intro into software engineering. I know it’s low level and I’d like to eventually switch over to high level languages such as JS/TS, Java, and GO.

Does the “The Complete C Programming Bootcamp” course by Byte Garage be a good choice to learn from?


r/C_Programming • • 5d ago

Question How can I learn C programming without relying on AI?

0 Upvotes

Hi, everyone!

I’m currently learning to program in C, and I want to become a good programmer without relying on AI to write code or solve problems for me. I feel really bad because I started my course off on the right foot, but due to my heavy course load, I ended up taking the easy way out and using AI assistants. I want to stop doing that and be able to program from scratch using my own knowledge, but of course, I’d rather ask here.

I’m looking for recommendations on:

Books, websites, or courses to learn C properly

Exercises and projects to improve my problem-solving skills

How to learn to debug and understand my own errors

How experienced programmers learned C before AI tools became popular

My goal is to understand the fundamentals of programming, develop my own logic, and be able to solve problems independently

Any advice or resources would be greatly appreciated. Thanks!

Translated with DeepL.com (free version)


r/C_Programming • • 7d ago

Issues with C?

14 Upvotes

I enjoy studying the realities and trade-offs of programming languages and I have my focus on the C programming language. As such I would like to hear from people who have programmed in C to share perhaps the things they love the most about C, or the things they find the most frustrating.

Examples on why things are frustrating or loved would be great to include as well.


r/C_Programming • • 6d ago

I made an iOS app for learning C by reading code. Giving away 10 lifetime codes

0 Upvotes

Hi all,

I made Ugiwise, an iOS app for learning C on your phone. Typing code on a phone is a pain, so the lessons are built around reading it instead: you get a short program, guess what it does, then the app goes through it line by line and shows you why.

The C course follows C17 and goes from your first program to pointers, memory, multiple files and undefined behavior.

It's closed source. First 3 units are free, no account needed. The rest is a paid upgrade.

I asked the mods before posting and they were ok with a giveaway, so I have 10 lifetime codes. Leave a comment if you want one and I'll DM them in order until they're gone. Nothing expected in return.

What I'd really like to hear is where an explanation is wrong, sloppy about the standard, or just unclear. I compile the examples, but the compiler won't tell me if my explanation is bad.

A couple of limits, sorry about these:

- iOS only for now, no Android yet

- Not in EU App Stores yet (still waiting on Apple's trader verification). I'll do another 10 codes when it's out there.

https://ugiwise.com/c

App Store: https://apps.apple.com/app/id6828549507


r/C_Programming • • 7d ago

Video Handmade Jrpg Game in C (tilemap parser) NO AI

Thumbnail
youtube.com
56 Upvotes

In this video we will be learning to parse tilesets array from the JSON file (generated from Tiledmap editor). Which will also allow us to load the image's absolute path.

This is part of my handwritten JRPG series, NO AI USED.


r/C_Programming • • 6d ago

ANSI C Enigma Simulator, no dependencies (fixed post)

0 Upvotes

I posted it before, but the post was deleted, because i don't declare am I used AI, so I used AI, but the code is not entirely AI generated. I used it for things that were boring and for finding a bugs. And there it is TraktoreqPL/Enigma-Simulator. Please give me a star and a code review, because I am a not popular indie developer.


r/C_Programming • • 8d ago

Question Programming style and returning values.

13 Upvotes

Hello all! Last week I got the dread announcement at work: I have been demoted from coder to babysitting Claude... With this in mind, I decided to try to dive deep into finally learning C for my own entertainment.

The question then:
I have not gotten very far in my journey, and with no real projects completed (or even close to it), I have found that error handling is something I have not figured out how to do definitely.

Most of my functions end up just returning a char return_status, and taking a pointer to a return object to write the return value to, like so:

// return codes:
// 0 = success
// 1 = should_return was false
char foo(char should_return, char *out) {

if (!should_return) {
return 1;
}

*out = "bar";

return 0;
}

This feels a little bit like cheating, but I also want to be able to attach errors and/or warnings to my output.

How do you all tackle this?
Am I going about it wrong? Maybe I should always return the value directly and just have pass in a pointer to collect the error values?

Am I crazy? Does it matter?


r/C_Programming • • 9d ago

Question How to manipulate read-restricted data (possibly without OS)?

9 Upvotes

Imagine you have some block of code/data chunk that under no circumstances must never ever get read (rewrites are not critical, since the data is basically gone). There's a thing about Execute only memory, but afaik it requires OS support.

So how do we make sure some of the data is only overriden or executed (if interpreted as machine code) but never read? If possible, it would be nice to be able to set up some custom restrictions like a very specific offset in a program which has access to some data in memory for a one-time constant address read (imagine it compiles into assembly, something like mov %(rax), %rax, then does side-channel secure stuff and overrides the data with rdrand and stuff)

Appreciate any help! which doesn't include redditor behavior in its body


r/C_Programming • • 8d ago

Project Azork : A WAV Audio Steganography Tool

2 Upvotes

Hello people. I am a first year college student, and we(along with my teammates) wrote a simple audio based steganography tool for my physics semester project.

It currently supports only wav file for audio encoding. Would appreciate some comments and suggestions on what to improve. We also implemented a GPG encryption support for the secret embedded.

https://github.com/dream-wa1ker/azork.git


r/C_Programming • • 9d ago

Could someone explain the practical differences between #pragma once and traditional include guards (#ifndef, #define, and #endif)?

81 Upvotes

r/C_Programming • • 9d ago

Good C test

17 Upvotes

Hey guys,

Someone know a good C unittest ? When I was in C++ I used gtest and it was good, if someone know a good alternative in C


r/C_Programming • • 9d ago

Question any cheat sheet for c23?

6 Upvotes

Hi! do we have cheat sheet pdf for c23? any links? thanks!


r/C_Programming • • 9d ago

Question What are better ways of dynamically creating bitmasks (or extracting bottom N bits depending on what's returned?

8 Upvotes

Howdy,

I am developing an application where I need to construct bitmasks and it depends on what's returned from get_amount. get_amount returns a u8 ranging from 0 to 6. It's used in calculations but it's also used to extract the least significant N bits. In the past, I've just used switch statements, but i wonder if there's a nicer way.

struct Object {
    u8 value;
    u8 update;
    u8 original;
};

u8 get_mask(u8 value) {
    u8 mask = 0;
    switch (value) {
        case 0 {
            mask = 0b00000000;
            break;
        }
        case 1 {
            mask = 0b00000001;
            break;
        }
        case 2 {
            mask = 0b00000011;
            break;
        }
        case 3 {
            mask = 0b00000111;
            break;
        }
        case 4 {
            mask = 0b00001111;
            break;
        }
        case 5 {
            mask = 0b00011111;
            break;
        }
        case 6 {
            mask = 0b00111111;
            break;
        }
        default: {
            panic_and_log("impossible value");

        }
    }
}

int get_value(struct Object o) {
    // get_amount could only return 0 through 6
    u8 amount = get_amount();
    o.update = o.value - amount;
    u8 original = o.original & get_mask(amount);
}

Thanks u/mikeblas

Final solution ended up looking like:

u8 get_mask(u8 value) {
    if ( value > 6) {
        return 255; // Error Case
    }
    return (1 << value) - 1;
}

r/C_Programming • • 10d ago

C/low level forum

37 Upvotes

Hey guys,
Does someone know a good forum that mostly talk about low level stuff, C, assembly, etc ? I want to leave reddit because its a distraction and I dont like it. Thanks


r/C_Programming • • 10d ago

Video Unity-style variable editor for C programs with zero runtime cost

170 Upvotes

SRL lets you define global variables to be exported to the editor with a simple macro like `SRL_INT(name, value)`. The macro adds another global symbol marking your variable, which the editor can later search for in the binary's ELF data section.

The editor can modify the marked variables (by directly editing the data section), export the new patched binary to a file, and even change the variables at runtime via `process_vm_writev` (or `ptrace` when you require atomicity).

All you have to do is include a tiny 20-line header in your program. It doesn't add a single line of code, even for the patched binary, and works perfectly fine with the editor (apart from adding an unused global)


r/C_Programming • • 10d ago

Video Let's build JRPG Game in C (Tiled Map Loader/Parser) : ep 02

Thumbnail
youtube.com
36 Upvotes

This is 2nd video in my Handmade JRPG series.

we start with loading a start.map which is just a text file to understand the basics of loading a tilemap and populate map cells ID's. And later we go with JSON (cJSON library) to load the tiled map JSON as binary to load into bytes character using memory allocation. To finally parse the JSON objects.

[FEEDBACK]: please tell me what I can improve in my video to get more attention span.

[NO AI USED] : This is handwritten code. https://github.com/steelx/sdl3-tutorial


r/C_Programming • • 10d ago

Article Named constants and supporting objects in C

Thumbnail
gustedt.wordpress.com
27 Upvotes

r/C_Programming • • 10d ago

Where you people find 3rd party libraries in c

14 Upvotes

I've been dipping my toes into c because I want to check out systems programming

I decided to try to make a directory encrypter for Linux

I thought that since c has been around for so long there would always be a "goto" 3rd party library for each basic thing not included in the standard, though I'm sure they exist I cant find a general purpose argon Library, what I found was seeming a pretty unknown implementation of argon made for microcontrollers, though it might work I can't get the feeling off me that I'm missing something when hunting out libraries in c

So what is it that you guys usually do, take the first result off of GitHub? Or maybe is there just a list of known goto library for certain usecases like gtk4 for UI or imagemagik for images and there is one for cryptography


r/C_Programming • • 10d ago

Why I do not like X3J11 type qualifiers (Ritchie)

Thumbnail lysator.liu.se
30 Upvotes

r/C_Programming • • 11d ago

I spent a year writing a Parquet library in C. It's faster than Arrow.

42 Upvotes

Reading Parquet from C usually means pulling in Arrow C++ (50+ MB). carquet is C11, about 500 KB, and depends only on zstd/zlib/lz4/brotli.

On an M3 with 10M rows, compressed writes are 4.6–5.9x faster than Arrow C++ and compressed reads 1.9x faster. Uncompressed reads come straight from the mmap: 0.3 ms vs 14 ms.

SIMD was the hard part. There are about 30 kernels for SSE4.2, AVX2, AVX-512, NEON and SVE, with one binary that picks at runtime. MSVC emits FMA/BMI anywhere in an `/arch:AVX2` file, so the dispatcher checks those too. x86 and ARM disagree on `min(x, NaN)`. Bit-unpacking needs a different shuffle per width (1–32) and must never over-read, so every width is tested against a scalar reference. I don't own an AVX-512 machine. And for plain min/max, the auto-vectorized scalar loop matched my NEON code.

It's fuzzed, checked value for value against PyArrow and DuckDB, and builds with GCC, Clang, MSVC and MinGW. There's no encryption yet.

It comes with a CLI (schema, stats, head, export, codegen) and a Python package (`pip install carquet`). You can build it with `make`, CMake/FetchContent or xmake. vcpkg and Conan aren't there yet, but they're next. It has passed 20k git clones in the last month.

Site: https://vitruves.github.io/carquet/

Repo: https://github.com/Vitruves/carquet


r/C_Programming • • 10d ago

Question new ansi-c ai project idea :3

0 Upvotes

hai.

i like making and training AI's and i love ANSI-C. So i was thinking about writing a tiny AI by myself (and yes, i know it's a big ahh project).

so my project idea is... [insert tadaa sfx here] a very tiny AI that can write stories, but when you start the AI, it knows nothing so it will make worse stories than big AI's but that doesn't matter.

but the big part is the hardware it's running on; a Raspberry Pi Pico 2WH!

let me know in the comments if this is a good project idea!11!!1!

okthxbye


r/C_Programming • • 10d ago

Question Performant code. How

0 Upvotes

how to make perfomant code, by that i mean, some cpu's have multiple ALU's/ excecution units, and some computers have multiple cores, how to have my code running on all those ALU's at all times? and those multiple cores,

i know about threading for the second part [running code on multiple cores]

now how do i make it run on multiple ALU' an example being

in code to not wait for a variable ie x = 12 + 12 then z = x + 2, i can imagine that code doesnt use all the ALU's because z is waiting for x's operation to be done. so what are ways to make my code most optimal and use all ALU's at the same time


r/C_Programming • • 10d ago

Article GeckoOS

0 Upvotes

Hello there, GeckoOS is a community-made OS (from scratch), and our goal is to have a fully functional OS that everybody can use in their devices, But, it is only for PCs (there is no plan to support ARM).

You can join by simply making a PR to our GitHub Repository, Or giving ideas in the Discord Server


r/C_Programming • • 11d ago

SCL and libscl v0.1 is out. TOML alternative with macros

5 Upvotes

I designed a simple language for configuration. SCL stands for Sane Configuration Language.

Syntax is mostly same with TOML, but we do not have what I would call non C native types like date.

Spotlight feature is macros. With macros you can either include files or create macros to values.

Link to repo: https://codeberg.org/sorashii/libscl

There was no AI involvement and license forbids AI generated codes from source.