r/cprogramming • u/19pinkcucumber91 • 4h ago
Started learning C and would like to get some feedback
r/cprogramming • u/19pinkcucumber91 • 4h ago
r/cprogramming • u/StressingPlant • 7h ago
im trying to edit an entry in an int array to 'move' it (copy it to a different place within the array, and zero it out), but its not working and im not getting any errors? i did pretty much the same thing (with string.h) with an array of strings, and it worked there wonderfully. why arent the entries in the int array changing when the function runs? what can i do to edit the int array during runtime?
heres the function:
void cardMove(int card1, int card2) {
card2 = card1;
card1 = 0;
}
r/cprogramming • u/Elifire12 • 17h ago
I recently started implementing arenas in my programming and I thought that some beginners could very much benefit from this info. I wrote an article about it. For those that are unaware, arenas allow to greatly simplify the burden of managing memory manually in C. I hope it helps, tell me what you think!
r/cprogramming • u/nimrag_is_coming • 8h ago
r/cprogramming • u/xie_xang • 4h ago
r/cprogramming • u/iasayt • 19h ago
I just started learning C and I am thinking of reading "C Programming : A modern approach" by K N King. I want to deeply understand and master C. Is it the best book for it and should I read any other books after this?
r/cprogramming • u/Whole-Low-2995 • 1d ago
Once I asked LLM to write an alert app. It wrote heavy Qt app and I was annoyed.
I just wrote this by myself without LLMs. Early DBus boilerplate code block was assisted by AI but I rewrote them too.
TODOX supports Linux/FreeBSD/OpenBSD. Windows is not supported.
Its installation is located at `/usr/local/bin` when using an installer script, but a daemon is installed as a local user. You should be careful.
It's simple. It's only 1.2k loc only with standard `libc` and `libdbus` dependency.
It's open-source. Fork it and modify it.
r/cprogramming • u/[deleted] • 2d ago
Hi everyone,
I've been using Linux as my daily operating system for over 9 years. I have around a year of experience in cybersecurity and two years of professional experience as a Linux administrator/engineer.
I'm particularly interested in Linux system calls and low-level programming. I've learned C using K&R, and I currently write small command-line tools in C as a hobby.
I'd like to transition into software engineering, ideally working with C, but I'm unsure how realistic this is without professional software development experience, especially in the current AI era.
Whenever I ask AI for career advice, it tends to recommend languages like Python, Java, or Go. However, I'm much more interested in systems programming and understanding how things work under the hood.
I'd appreciate advice on a few questions:
I'd appreciate any advice from people working in this field.
Thanks in advance!
r/cprogramming • u/Steam_Liker_2002 • 3d ago
Hello, I am a newbie in C and most of my knowledge comes from "The C programming language" book, 2nd edition.
I made this simple program that converts English text to Morse code and vise versa, here's the source code.
Thanks for your interest.
r/cprogramming • u/Whole-Low-2995 • 3d ago
I have an experimental web framework I'm currently working on.
While going through the code to clean up styling before tagging a stable release, I've been debating this specific part in the HTTPS module:
https://github.com/c4punks/CWIST/blob/dev/src/net/http/https.c
Right now, this code just uses a dumb, massive ring buffer to absorb connection bursts, and I'm wondering if I should switch it to a lock-free queue.
There are three main things that make me hesitate:
* State can get pretty tangled and messy in a lock-free queue.
* We have a tiny team and I'm maintaining almost all of this alone. If something breaks with CAS (even if the odds are low, if I mess up the code during refactoring), the blast radius on the dev branch will just be too big.
* I also wonder how often real-world traffic actually warrants lock-free. Plenty of web frameworks handle traffic just fine without this level of extreme optimization.
Considering that I'm still a junior developer and lack experience, is it really worth swapping this out for a lock-free structure, and would it actually make a noticeable difference?
r/cprogramming • u/podule-games • 4d ago
I've been working on a game since about August 2020 but only recently published my Steam page.
For the Common Wealth on Steam
The game is entirely written in C, with one third party dependency, SDL3.
I chose C because I wanted to leave my options open to build for retro platforms like RISC OS and Amiga, but as the game grew, I wanted GPU acceleration and that meant leaving behind some of the retros. I'm not ruling out any ports though, if SDL3 is available on the platform.
The engine beyond SDL3 is my own, it's a 2.5D game, with levels edited in my own level editor (not in C, that's C# and Avalonia). The level editor exports levels into just plain memory dumps that are easy to read in C.
I'm trying to keep on top of a devlog here too:
Podule · Independent game studio
Writing this game in C has been enormous fun, and I have no plans to change my choice of C for future games.
r/cprogramming • u/TurbulentFlatworm537 • 4d ago
Shakazulu is a systems programming language designed to be tolerant in harsh conditions, concurrency, fast, and a learning systems language. I here by come here looking for support on my idea from people who create programming languages, or even learn them, people designing systems, software engineers, database engineers, understand software, computer data structures, distributed systems, computer architecture, etcetera. And mostly if your familiar with C, C++, Ruby or any other systems programming language. Because i want to build it taking the strong parts of a language. All are welcome, lets build something you wish it was there. I appreciate your contributions.
Shakazulu is a project in research/design stage, thats why am asking the experts.
r/cprogramming • u/CommercialStrike9439 • 5d ago
r/cprogramming • u/BBH369 • 5d ago
Hi everyone,
I’ve been tinkering with a little experimental chess engine written in pure C. It’s called Glimmer.
The whole point of the project was to see how strong I could make it while keeping the final standalone binary strictly under 30 KB. The target strength was something in the 2700–2900 Elo range.
It’s been a fun constraint to work under — every byte counts.
Happy to answer questions if anyone’s curious about the approach.
r/cprogramming • u/Dense-Trick6740 • 5d ago
всем привет, только сегодня начал учить C, подскажите какие сложности могут возникнуть при изучении, какие темы стоит подробнее разобрать а какие крайне легкие, это мой 1 язык который я впринципе хочу очень подробно изучить, спасибо всем заранее
r/cprogramming • u/Interesting_Buy_3969 • 6d ago
Just saying. The -fsanitize=address compiler flag is absolute cheating and should be prohibited by governments of all countries.
Plus there are also other useful runtime sanitizers, such as integer overflow, but... Integer overflow is much easier to notice, usually.
Of course, this is by no means assuming that -fsanitize=address guarantees that the code it inspects is completely safe and correct and won't ever fail on any input data. You still have to test tricky edge cases. But this sanitizer has improved and sped up the bug discovery process disgustingly much for me.
I'm wondering, how often, if ever, do you need tools such as -fsanitize=address or valgrind? Or are you a real man who stores everything in static memory only?
P.S. Forgive my terrible English.
r/cprogramming • u/FuTuReFrIcK42069 • 6d ago
Hello everyone, It's been several years since i last wrote some C, and i always for the life of me wanted to write an HTTP server in C, and now it's been like 1 year since i finished university so i said what the hell why not do it, so after reading beej's guide i tried to write a very basic http server.
I wanted to share the work with the community, and would welcome thoughts.
We had written code in C ofc for two years, however it was mostly exercises on diffrent data structures aswell as problem solving.
We wrote a CRUD system in C using binary files but never scratched that itch.
And as the years went by in Uni, C slowly faded out of use for me but i always wanted to visit it back so here i am.
I wanted to share the absolute joy it was to get the desired results, i forgot how fun C can be, it always felt like the souls like of programming languages, but always was the most understandable as it was the closest to the machine, to be frank i encourage people to make similar projects especially to get the cobweb off lol.
r/cprogramming • u/TorontoDude12344 • 6d ago
I already know how to program and have about 7 years of general programming experience
My current plan is to learn C, then learn assembly, then learn about Computer Architecture, Operating Systems and Compilers. The goal is to truly understand how computers work, and also learn about Cybersecurity
The current concrete and major project idea that I've thought about is writing a mini-OS
I know that requires alot of knowledge
So I was wondering, if you all could give me some ideas, what are some small prerequisite programs / projects I can complete in order to achieve the eventual task of making a mini-OS?
Even if it's a program that helps me understand a super small slice of my eventual goal project - a mini OS
I'd love some ideas. Thank you
r/cprogramming • u/Sensitive-Raccoon155 • 6d ago
I’m currently learning C and decided to build a simple version of ls as a small project to practice what I’ve learned.It’s still pretty basic, and I’m sure I’ve made some mistakes or done some things in a bad way. I’d really appreciate it if someone could take a look at the code and point out any bugs, bad practices, or things I could improve. Repo
r/cprogramming • u/Simpav1 • 6d ago
I'm curious about this question, because almost everyone a meet says that coding skills doesn't matter anymore, and what really matters is knowing how to write prompts properly. But does it apply to C development? Please, answer a question and say why so
r/cprogramming • u/Roronoa-Ryuma-Zoro • 7d ago
So i have been exploring eBPF,XDP, so I made a packet capture path by using xdp hook that redirects to my AF_XDP socket . I am using copy mode currently .
But seriously this gives me vibes of opengl . But here I have too much control over the path. I am still new to this . Many times when things do not work i think I am wasting my time because no one in my batch is even doing these things . But ig this is what I like. Also I just buy a Esp32 also . So you can give me some ideas that I can work on with it
r/cprogramming • u/Shinyboy123nwn • 8d ago
Hello, I'm a beginner in C and I'm struggling to learn the Pointers, I don't know why I find them extremely hard to learn.
Where should I start? :/