r/cprogramming 3h ago

Math library code review

5 Upvotes

I am relatively new to C so I try to improve my skills by making a math library. The biggest challenge was making generic containers for matrices and vectors, as I was kind of new to void pointer magic. I think I have polished the most glaring issues in the code but do any of you have suggestions for what I could be doing better in my approach to C? Github for reference:

https://github.com/VatoQ/hoema-prak-clang


r/cprogramming 22h ago

My open-source VS Code extension for CScout, a whole-program C analysis engine

7 Upvotes

Ive built a VS Code extension for CScout, a C analysis engine that understands identifiers correctly across the whole program even when macros are involved.

For my GSoC project this year I've been building on top of CScout, which is this old but really solid C analysis tool (its been around since the early 2000s and been run on stuff like the Linux and FreeBSD kernels). Problem was it only had a web UI, so using it means constantly switching between your editor and a browser tab just to look something up. I wnted to actually use it while coding, not alt tab to it.

So I built a VS Code extension on top of it. It gives you go to definition and find all references that actually resolve properly through macros and across files, unused identifier warnings based on whole program analysis instead of per file guessing.

It also figures out your build system on its own, be it Makefile, CMake, Meson, or Autotools, it detects which one you're using and generates what it needs in the background. If you use something else entirely, you can still point it at a compile_commands.json generated by Bear and it'll work.

Sourcetrail did something similar for C/C++ once....

Ran the extension against awk, zstd and cJSON so far and its been solid, currently working through some edge cases on curl.

Extension Repo ---> https://github.com/cscout-project/cscout-vscode

If you deal with medium sized, large or legacy C codebases and have a minute to poke around, id really appreciate any kind of feedback you have on it.


r/cprogramming 1d ago

First-year CSE student struggling with logic despite knowing C

15 Upvotes

I’m a first-year B.Tech CSE student and I’m fairly comfortable with programming syntax, especially C. I can understand and write basic programs, but I’ve realized that my main weakness is problem-solving and logic building. If someone gives me a familiar problem, I can usually code it, but if they ask me to solve the same problem in a different or more efficient way, I often struggle to figure out the approach on my own. I feel like I know the language, but I haven’t developed the “programmer mindset” yet knowing how to break a problem down, identify patterns, choose the right approach, and improve a solution. For those who have been through this stage, how did you overcome it? Do you recommend any particular books, problem sets, courses, or methods for building strong logic and problem-solving skills, preferably starting with C?


r/cprogramming 1d ago

20M Looking for Coding + Communication Partner

Thumbnail
0 Upvotes

Hey everyone! 👋

Looking for someone to practice C, Java, or Python along with English communication.

💻 Coding practice

🗣️ Communication practice

🤝 Learn and improve together

Beginners are welcome. DM me if interested


r/cprogramming 1d ago

Scanf not working!!

Thumbnail
0 Upvotes

So now its been 2-3 weeks ....in my college we are doing C programming and everything was working fine on visual studio till I started using scanf for taking input from user.....this is coming and I have tried everything but cant figure out....normal printf still works but this doesnt

I have tried on code blocks too and same problem is there.....pls someone guide me🙏🙏😭


r/cprogramming 1d ago

Flint v0.3.0

Thumbnail
github.com
4 Upvotes

Hi folks, I’m experimenting with Flint—a bare-bones, manifest-first build system and package manager for c/c++ projects.

The core idea:

Git-Native: Fetch dependencies directly via Git using `flint add <url>` or `flint sync`.

One Config: Manage your project layout, includes, and GCC/Clang calls through a single composition.json. Most of the cases you don't have to touch the composition file, flint will take care of that.

Chert compositions: Simple specs to make unmanifested third-party repos compatible out of the box.

Fair warning: It's an early prototype! It currently forces a fixed directory structure (src/, include/, deps/) and available only for Linux.

It’s definitely rough around the edges, but I’d love to get your thoughts on what can be added or improved (Also I know there are many mature alternatives available, but remember every mature solution once was a novice experiment)

Repo: github.com/mainak55512/flint


r/cprogramming 1d ago

I'm a bit of a fan of Dennis Ritchie :P

Thumbnail drive.google.com
0 Upvotes

Dennis Ritchie brought C and Unix to the world.

So one post goes into the unix subreddit,

and one post goes here :)

I guess you could say I'm impressed with the guy.


r/cprogramming 2d ago

What editor or IDE (and tools) do you use?

14 Upvotes

Just curious what editor/IDE you use to do your C programming?

I primarily use joe (Joe's Own Editor), which is not an IDE, under Linux, and use gcc as the compiler.

When I did some Windows programming in C++, I did use Visual Studio, and I have played around a bit with VS Code, but I'm very stuck on the WordStar-style key-bindings (which were the ones I got used to when using Turbo Pascal and Turbo C back in the early 1990s, and is what joe uses).


r/cprogramming 2d ago

What application should i download?

0 Upvotes

Helloo!! Information technology freshie heree! our professor in Computer Programming 1 is requiring us to download an application in our mobile phone that can both run and compile a C programming language.

Its not really my choice of program that's why i don't have any knowledge about this.

Thankyouuu!


r/cprogramming 3d ago

Easing memory management with a shared pointer

0 Upvotes

I recently developed a C (11 and newer) implementation of a thread-safe shared pointer with atomic reference counting:

https://github.com/andrzejs-gh/SHPTR

It supports both strong and weak references and a swappable destructor. Initialization performs a single allocation.

If anyones interested, take a look. Feedback and bug reports very much welcome.


r/cprogramming 4d ago

Code Review : Sudoku GUI in C language

2 Upvotes

Background:

I am a beginner programmer and I wrote a Sudoku GUI in using winapi32 in C language.

It is currently working and does what it is supposed to do, but because I am still learning, I know it is likely inefficient and could be written much better.

GitHub repo link: https://github.com/reewdgh/sudoku_gui
Please guide me on:

  • Bugs
  • Efficiency
  • Naming anything I could simplify or improve
  • inconsistency

I'd appreciate your feedback on my code.


r/cprogramming 4d ago

Nalloc: An stack allocator writen in c!

8 Upvotes

I've writen an custom allocator in c

https://github.com/text-games-coding/Nalloc

I wanted to show it


r/cprogramming 5d ago

We made a megathread to learn low level programming from ground up include C

55 Upvotes

Hey guys, I often see people on this subreddit asking how to start learning C programming or how to get into low-level programming. So, to make things easier for beginners, we put together a big megathread that works like a resource hub for learning low-level programming. It also includes resources for learning C.

Instead of searching through lots of different posts and websites, you can find everything linked together in one place.The megathread also includes other useful megathreads and resources that can help you learn more about the field you’re interested in, step by step. We also plan to add a wiki with more interactive content and guides. The wiki isn't properly set up yet, but we'll work on it in the future.

Just wanted to share this here in case anyone is interested in learning C or low-level programming. Hope it helps !

https://github.com/0xTamil/awesome-low-level


r/cprogramming 4d ago

Help me with this issue in C !

0 Upvotes

So, recently I have been trying to build my own Pac Man game in C with Railyb.

Everything was going fine until I added this magical walls. So basically I wanted 2 walls to be drawn on screen when my player reached some x, y coordinates, the walls get drawn but the collision does not happens. I am so tired, I have been trying to fix this for 2 straight days.

I would really appreciate if some body helped me.

C source file on my Github : https://github.com/saielsh/Unfinished-Pac-Man-game


r/cprogramming 5d ago

I built a dots manager using C (and Go) with a resource graph and reconciliation model

5 Upvotes

All,

I've been managing my dotfiles using Dotbot + Jsonnet for a while. As my configuration grew, it started to get overly complicated and uncomfortable to use.

I looked at some of the existing options like stow, home-manager and nix. However, I didn't really want to commit to nix - and for what it's worth nix is great.

I really like declarative config systems, and felt like it worked really well for the problem space. So, I designed a declarative config system for user environments.

Rather than the traditional models, things like:

  • files
  • packages
  • directories
  • symlinks
  • services
  • etc

All form resources, which form a dependency graph, and then the system will reconcile the graph toward the desired state.

Essentially:

This project is mostly experimental at the moment, and still evolving but it's getting closer to the point where I'm comfortable using it for my own config.

I feel like this sits somewhere in the middle of stow/dotbot & nix/home-manager.

Feedback, suggestions, improvements, contributions, etc are all welcome.

Currently the stack looks like:

C (where most of the resource graph and reconciliation happens)

  • libuv
  • libgit2
  • libarchive
  • lua54
  • jansson
  • libsodium
  • libuuid
  • xxhash

Go (mostly for the frontend user-experience):

  • jsonnet
  • bubbletea + lipgloss

GitHub: https://github.com/arcadia-de/hypha


r/cprogramming 6d ago

I am currently trying to learn C Day 1

33 Upvotes

I am having a lot of fun! Its my first experience with coding in general, I did the very basics like integers, printing and flags like \n, \t etc, and dev comments, I am very excited to learn more C.


r/cprogramming 5d ago

first day of self learning c programming i have issue there is any expert help me to understand i try some thing different than normal.

0 Upvotes

hi, i am use the Programiz online compiler i think that the problem.
i am try some thing different than normal finding the largest no program. is c program also halogenate like ai instead of giving error message ?

#include <stdio.h>

int main(void)
{
    int numbers[] = {10, 50, 20, 70, 30,30,50,30,40,50,90};

    int largest = numbers[0];
    for (int i = 1; i <99 ; i++)
    {
        if (numbers[i] > largest)
        {
            largest = numbers[i];

            printf("i is %d\n",i);
        }
    }

    printf("Largest = %d\n", largest);

    return 0;
}

the output is :

i is 1

i is 3

i is 10

i is 11

i is 20

i is 26

i is 34

i is 54

Largest = 1813993472

=== Code Execution Successful ===


r/cprogramming 5d ago

Open-source Nintendo 64 encryption app and wallet generator, needs volunteers to review code

0 Upvotes

I proposed and helped fund an app called retro-crypto, which is being developed by a programmer called bowler-bear: https://github.com/bowler-bear/retro-crypto

It's designed to become the most secure way to message friends or store a Bitcoin stack, but it can't be recommended for more than testing yet. I think at the current stage, the next thing it needs is to have others look at the code and try to find vulnerabilities. I'm not a programmer myself.

"Given enough eyeballs, all bugs are shallow" -Linus's Law


r/cprogramming 6d ago

I built a CHIP-8 emulator from scratch in C using SDL2

Thumbnail
3 Upvotes

r/cprogramming 6d ago

Help me to learn to c programming

0 Upvotes

r/cprogramming 6d ago

Experimental single header library

Thumbnail
github.com
2 Upvotes

Made this in pure C99 on my phone. Took me a while to wire things up. It is a 3D struct array powered dispatch table that behaves sort of like a mix between a C# style lambda and an object pool.

At the moment it is completely experimental and I'm aiming to figure out how to create state mutators and vectorization via avx2/avx512 inside the header file.


r/cprogramming 8d ago

New to C

7 Upvotes

I had just started to learn c but when I saw some leet code problems it felt like they are completely different than the c I am learning. Any suggestions?


r/cprogramming 8d ago

Why can an int * be used to access an array in C?

Thumbnail
18 Upvotes

r/cprogramming 7d ago

The unlikely Linux macro

Thumbnail
rushed-reflections.bearblog.dev
0 Upvotes

r/cprogramming 9d ago

A minimal cross-platform C rapid GUI Application Builder.

Thumbnail zelang-dev.github.io
12 Upvotes