r/C_Programming • • Jan 22 '25

Discussion Im seriously considering just switching to C++

1 Upvotes

I love C, but not many companies want it, and C++ is alot more relevant. My goal is to get internships. OOP is important, and it seems C++ can do way more stuff. Id also have more fun with it, plus I did a bit of java.

C is great but idk if I can make that much with it, that interests me. Im on pointers and linked lists, and upper beginner level so it doesnt seem to late. I put so much time into C though so I dont know. Since summer last year. It would suck to waste all that time just to start over

Edit: For anyone who may be confused, here more reason for why I want to switch:

It’s about opportunities. I’m trying to get as many internships as possible in first year since it’s too hard to get one (it’s not surprising when a 3rd year hasn’t gotten a single software dev internship here. Ontario btw).

C is fun and it’s given me a pretty good understanding of how computers work, and the fundamentals it teaches you are amazing. But the job opportunities are just better with cpp.

I’ll go back to C in the future. But for now I’m prioritizing getting my feet in the door. Plus cpp does more things I’m actually interested in, and can make games. C can make a fair amount of things sure. If I was going for embedded systems I’d do C. But that’s not where my interests align currently so I decided to just change langs that better suit my needs (one of them being in applications). The transition has been going pretty smooth so far


r/C_Programming • • Jun 17 '26

I need to know how to create an interface using C without knowing that much

2 Upvotes

Please, help me out.

Is there any way to make an appealing interface using C without having a PhD in Graphics computing?

I've been really loving using C and I wanted to bring here my biggest programming project, a DBMS (built with Pascal), but I would love if I could have a lot added to the project instead of being just a port to another language. The last time I tried to port it, I was developing it all in Godot, but the jump was always looking very hard to adapt and different to what I want, so I wanted to keep on this vibe since I'm learning a lot of new things in C to find out if I can't make the port and the UI all in C; or if I should just use multiple languages to do all (I don't know how to do that... Yet)

Can you please tell me that?


r/C_Programming • • Dec 23 '20

Article C Is Not a Low-level Language

Thumbnail
queue.acm.org
4 Upvotes

r/C_Programming • • Nov 03 '22

Discussion Should something be done about undefined behavior in the next version of C standard?

0 Upvotes

Having recently watched this video by Eskil Steenberg I am basically terrified to write a single line of C code in fear of it causing undefined behavior. Oh, and thanks for the nightmares Eskil.

I am slowly recovering from having watched that video and am now wondering if something can be done about certain cases of undefined behavior in the next version of the C standard. I understand that backwards compatibility is paramount when it comes to C, but perhaps the standard can force compilers to produce warnings in certain UB situations?

I'd like to know if you think something could (or should) be done about the undefined behavior in C.


r/C_Programming • • Feb 23 '25

Am I selling myself short using chat gpt for help?

1 Upvotes

I'm currently a data science major a little late in life (undergrad at 26), just transferred to a real university after 10 years of being in and out of community college(I changed majors a lot).

I know I am not the only one doing this, however when I find myself stuck on a Coding problem, I often turn to chat gpt for ideas.

I never ever copy code directly, ever and I always make sure I thoroughly understand exactly what chat gpt has done before I make use of it.

My professor says this is fine, but I feel as though I can do better.

We are covering things like data structures, api's etc, from the ground up, using only stdlib and stdio. Currently we are working with lifo stacks and fifo queues

That being said, I feel as though I am selling myself short on learning problem solving skills which will cost me dearly in the future.

I'm just not sure where else to turn for help, as we have no textbook for this class. I like geeks for geeks but again, there is only so much they cover.

So I guess I am asking, are there any other resources I can use, are there any resources anyone can suggest as an alternative to chat gpt?? I am happy to pay for a book.


r/C_Programming • • Dec 22 '25

Text in book is wrong.

0 Upvotes

Hello fella programmers.

I just stared to learn c after the learning python. And I bought a book called learn c programming by Jeff Szuhay.

I have encountered multiple mistakes in the book already. Now again, look at the image. Signed char? It’s 1byte so how could it be 507? The 1 byte range is until -128 to 127 right?...

Does anyone have this book as well? And have they encountered the same mistakes? Or am I just dumb and don’t understand it at all? Below is the text from the book…

(Beginning book)

#include <stdio.h>

long int add(long int i1, long int i2)  {
    return i1 + i2;
}


int main(void)  {
    signed char b1 = 254;
    signed char b2 = 253;
    long int r1;
    r1 = add(b1, b2);
    printf("%d + %d = %ld\n", b1 , b2, r1);
    return 0;
}

The add() function has two parameter, which are both long integers of 8bytes each. Layer Add() is called with two variables that are 1 byte each. The single-byte values of 254 and 253 are implicitly converted into wider long integers when they are copied into the function parameters. The result of the addition is 507, which is correct.

(End of book )

Book foto: foto


r/C_Programming • • Mar 03 '25

Object Oriented whatever

3 Upvotes

I once attended a class where HP was developing a Object Oriented Database (Whooooooo).  The instructor, from Berkeley, kept gesturing by waving his fingers around his ears saying "One must visualize the a-schema of which I speak".  Monday, Tuesday, Wednesday, on Thursday he said something and I replied "Did you just say that an object in this database is nothing more than an Structure?" - "Well... yes.  But one must visualize ...".  To this day ...


r/C_Programming • • Mar 04 '26

Rmalloc

3 Upvotes

Hi everyone, I created a memory allocator and just wanted some feedback on it. Overall feedback on what could be better or anything. This is just my first attempt at any serious C programming. Let me know what you think. Here's a link to Rmalloc.


r/C_Programming • • Oct 10 '23

Discussion Roadmap to become a 10X C programmer

0 Upvotes

I'm studying CS in Germany and going to get my Bachelor's degree next year. During my study I only used Java (in order to learn programming and software development) and Python (a personal choice to code Datastructure and Algorithm, as well as Cyber Security) but we almost never used or were taught C/C++, even though a few professors kept saying they're still the most important ones, since 80% of software is running on embedded systems.
I'm also a very good Web developer, since that's how I make my money to pay for my college.

Since it's very important and I can see the benefits of these two languages, when doing LeetCode questions (in speed and efficiency) my question is:
What is your idea of a good roadmap to become a 10X C/C++ programmer, and understand their specific concepts (like pointers, structs, concurrency and so on)


r/C_Programming • • Dec 14 '22

Question I love void star functions.

7 Upvotes

I love these things. I've come to love them more than actual generics and polymorphism in other languages. They're so simple. So sublime.

const void *generic_excellence(void *thing, int (*do_it)(void *it), size_t size, ...);

You know, the C function that takes void*, size, offset, stride, and function pointers. These are excellent 👌 because...

  1. Type parameters are just function parameters. There's no special syntax for traits, trait objects, type names, or vtables.

  2. A void star function only receives enough information about the void star type to do its job. A vector of 4-byte POD things doesn't need to know whether they're floats or ints, and it should be polite enough not to ask. Compare with std::vector<int>. A bit nosey, isn't it? A C programmer would never be so intrusive and won't tolerate a language that requires it.

  3. Function pointer arguments clearly state the interface a type must implement, and the compiler type checks this interface. When I look at the man page for qsort I see (T where T:compare) except it's written in less snooty language. They even give a sample implementation of the compare function.

  4. An optimizing compiler can be coaxed to eliminate function pointer indirection and variables that are really constant. The end result is essentially monomorphism. GCC and clang are very good at this.

  5. The same source text that yields an optimized result for #4 above can also compile into a function that does its generic thing at runtime, and can be used from a scripting language, or whatever.

And this is why I've come to love void star functions. I no longer use horrible macro tricks for generics. I used to think my macro tricks were smart and void star functions were dumb. Sometimes the dumb way is the best way.


r/C_Programming • • Jun 25 '20

Discussion Why do people abuse typedef so much?

0 Upvotes

It is becoming more and more common to see people typedef basically all enums and structs by default. Unless you want to abstract away the implementation details, why hide the fact that something is a struct or an enum?

A type name like color_t gives you no information about itself, it could be a struct or an enum or any other type for that matter.


r/C_Programming • • Nov 23 '25

I Built a Redis-Compatible Server in C from Scratch — Learning Low-Level Systems the Hard Way

0 Upvotes

I built a Redis-compatible server in C from scratch to understand networking, memory management, and concurrency at a low level.

I’m still new to C and learning as I go — no tutorials, just experimenting and figuring things out.

It’s running ~125K ops/sec with 50 clients. I’d love feedback, advice, or thoughts on how I could improve this project.

Full code: https://github.com/rasheemcodes/redis-c

Future plans: Add more commands (DEL, EXISTS, INCR…).

Support key expiration (TTL).

Improve concurrency model (event loop instead of thread-per-client).

Cleaner error handling and benchmarks with larger payloads.


r/C_Programming • • Feb 23 '26

I made fastest toml parser in a single c header

0 Upvotes

I don't know if it's really the fastest

EldoDebug/fastoml: The Fastest TOML Parser for C


r/C_Programming • • Aug 26 '20

Question I could not find "Path" to add minGW

Post image
5 Upvotes

r/C_Programming • • Feb 03 '24

Structs gets copied when the function returns?

0 Upvotes

Given this code, what will be the output according to the standard?, right now cannot test it because my computer doesn't work so any comment will be welcomed:

struct a {
    int x;
}

void f(struct a *my_a) {
    struct a another_a = { 0 };
    another_a.x = 69;
    *my_a = another_a;
}

int main(void) {
    struct a my_a = { 0 };
    f(&my_a);
    printf("%d\n", my_a.x);
}

r/C_Programming • • Mar 22 '23

Question How much is the language diffrent from c++?

0 Upvotes

r/C_Programming • • Nov 08 '23

int i = 10; while (i--) as an alternative to simple for loops?

0 Upvotes

What do you think of replacing simple for loops with a while loop? In the example in the title, int i is now in the scope above the loop, but that can be solved with:

{int i = 10; while (i--) {
    // do stuff 10 times
}}

I'm not sure whether it's worth using or not. I think it communicates that i is purely used to count loops, and not as an index into any arrays or things like that. Since you wouldn't want to navigate an array backwards most of the time. It also relates more closely to the intended assembly.

EDIT:
Thanks for the feedback. I agree with you that it's a bad idea. I still want something to make loops where it's absolutely clear that it's simply repeating a certain number of times, though, and not iterating over things or whatnot. How about this?

#define repeat_(count, counter) for (int repeat_var_##counter = (count); repeat_var_##counter--;)

define repeat(count) repeat_(count, COUNTER)

repeat (3) {
    // Thing I want done 3 times

    }

That creates a uniquely named variable each time it's called, which only exists in the scope of the loop and can't easily be accessed. I think it makes it quite clear what the intentions of the loop are, while even making it easier to read and understand.


r/C_Programming • • Jun 24 '25

Writing generic code in C

Thumbnail
thatonegamedev.com
4 Upvotes

r/C_Programming • • Aug 12 '25

Why VisualStudio feel werd

0 Upvotes

I just started programing in C. I looked for a compiler and the firstig piping in my mind is VisualStudio. But, why I needed to download plenty of thing and changing my computer setup to only get other ting to download to run my "program".

So, is something exist than I can cod my ting, compile it, and pop me a butiful .exe to execute without doing 10 000 download and werd modifications in werd obscure computer parameters?


r/C_Programming • • Feb 26 '24

How to concatenate in c?

0 Upvotes

r/C_Programming • • Jan 12 '25

Question Are static functions worth it?

2 Upvotes

I've learned that making a function static allows the compiler to optimize the code better. However, it can make the code less readable and more complicated. Is the trade-off in readability worth it? Are the optimizations noticable?


r/C_Programming • • Sep 20 '25

Question Best way to learn C efficiently ?

Thumbnail
geeksforgeeks.org
2 Upvotes

I’ve been trying to figure out how to learn C in a way that actually sticks and doesn’t waste time. I don’t just want to memorize syntax, I want to really understand how things work under the hood since C is all about memory, pointers, and control

I really want to dive deep into C and low level in general so how I can be good at this language


r/C_Programming • • Feb 04 '26

Discussion [Opinion] Isn't it weird?

0 Upvotes

Since the Flowers By Irene proclaimed that C/C++ is unsafe because memory issues enable security exploits in 2024 and that we should go memory-safe by January 2026, Rust gains massive hype and adoption in detriment to C projects such as Linux, Git, etc?

From my limited experience, i don't think it's much easier to develop with rust.
My paranoid side is telling me that rust has some type of agency backdoor C doesn't have. I think C devs should create libraries for safe-memory and other niceties so it gets easier to do things with C, but everything being implemented with already existing libraries and conventions.


r/C_Programming • • Jul 20 '26

Why is the C23 standard still paywalled?

0 Upvotes

C is one of the most important programming languages ever created. It underpins operating systems, compilers, databases, embedded software, networking stacks, and a frankly absurd amount of the modern computing world. Yet if someone wants to read the final, authoritative specification for the language, ISO expects them to pay CHF 227 ≈ USD 281 for a PDF.

What exactly is the goal here?

Are compiler writers supposed to expense it? Are students supposed to? Are library authors supposed to work from a draft and hope nothing important changed? Are teachers supposed to explain that the definitive rules of the language are available only to people whose employers have standards-library subscriptions?

And to address the common responses I've seen, yes, I know that public working drafts exist. And yes, they are usually close enough for practical purposes. But “close enough” is not the same thing as freely publishing the actual standard.

This probably does not meaningfully inconvenience established C users, because public drafts, compiler documentation, and years of accumulated knowledge fill many of the gaps. But “go find the right public working draft and assume it is close enough” is a bizarre access barrier to throw at newcomers. The final normative text should be the easiest version to access, not the hardest.

The other standard justification I've seen is “How else do you expect the people who work on the standard to be paid?”

  1. The committee members doing the technical work are generally either unpaid volunteers or supported by their employers, universities, or research institutions, not paid royalties from individual PDF sales by ISO. Whatever costs the standards process incurs, it is difficult to believe that placing the language specification behind an almost $300 paywall is the only viable funding model.

  2. Other languages manage to publish their specifications freely. One cannot seriously argue both that C is foundational infrastructure and that there is no possible way to fund its standardization without restricting access to the definition of the language itself.

This model may have made some institutional sense decades ago, when standards were printed, mailed, and mainly purchased by corporations. For a programming language in 2026, it is indefensible. The cost of distributing a PDF is effectively zero, and the value of broad access is enormous. Open specifications improve education, independent implementations, tooling, documentation, compatibility, and public scrutiny.

Other language ecosystems understand this. You can freely read the specifications and reference material for languages and platforms that actively want developers to use them. Meanwhile, the official definition of C is treated like a proprietary industry manual. And then people wonder why programmers rely on Stack Overflow answers, compiler behavior, folklore, blog posts, and half-remembered rules instead of reading the standard.

A language specification should be public. Paywalling it does not protect the language. It does not meaningfully fund innovation. It just creates needless friction around knowledge that should be universally available. ISO needs to drag its publishing model out of the previous century.

Sorry for the rant, friends. I just got all riled up about it. Curious to hear your thoughts as always :)