r/cprogramming • • Jan 19 '24

is c dying?

0 Upvotes

I am thinking if I want to learn c or c++ as my main language and while my heart tells me c my mind is unsure. it has to be 1 of these 2 because I want to write python ml extensions for gpus my plan was to learn c because:

  1. its easier

  2. better integrated with python

  3. it seemed to have a better future.

while the first 2 remain true the last 1 I am not so sure

I have recently seen a discussion for moving Linux into c++ and python ml libararies are also starting to be made in c++. I am not really sure if any new projects are being made in c...

it may be that the distinction dosent matter and I should just learn both. which is probably anyway going to be the case but I was really hoping to fouces on c much more and now I am fairly unsure


r/cprogramming • • Nov 02 '24

Is it even worth it to learn C? Does C even have a point?

0 Upvotes

I’ve been doing C for a few months, and I’ve been loving it. But what even is the point of this lang? Apparently, C++ gives just as much, if not more fundamental knowledge about programming, it performs basically the same, except C++ is more relevant and is used by more companies, while most companies don’t seem to care about C when they can just use C++. Am I just wasting time? I’ll still continue to learn it because I like it and I can do whatever I want when programming in C, but I just hope this isn’t a waste of time

Edit: I’m talking about for software dev

Edit 2: Also I’m in my gap year and I’m trying to learn as much as possible so I can get jobs in first year. Is C a bad idea?


r/cprogramming • • Jan 24 '24

Can you download C only without C++ coming with it?

6 Upvotes

Title


r/cprogramming • • Sep 27 '24

which software is good for coding ?

0 Upvotes

which software is good for coding ?


r/cprogramming • • Aug 03 '26

C for complete beginner. i want to learn C from 0.

1 Upvotes

i want to learn C from 0. maine CODE WITH HARRY ka C ka course dekha and i realize it is too old.

please please guide me how to learn c as a complete beginner


r/cprogramming • • Jul 22 '26

A C subset that compiles faster than Tiny C Compiler - Cm1 (C minus 1 or C - 1) programming language

0 Upvotes

Hi everyone,

I'm working on a programming language that compiles a subset of C. It is called Cm1 (meaning C minus 1) and you can writing and running C codes directly on your browser at https://cp1-lang.org/cm1/editor.html in a fraction of a second.

Why is it faster to compile than Tiny C Compiler? It is because Tiny C Compiler is a true compiler creating native binaries whereas Cm1 is a bytecode interpreter allowing you to test, debug, edit code and recompile very quickly or even do hot reloading. Cm1 can be used as a scripting language for shell scripts and video games, but this just a small use case because in theory, you can run 90% of your ENTIRE video game or software C program through Cm1's bytecode interpreter and leave 10% to compiled C and reap the benefits of very fast compilation and hot reloading.

100% Cm1 codes are compilable by GCC and Clang but the reverse is not true since Cm1 is just a subset of C. Major features that are omitted are function pointers, structs/unions inside functions, nested structs/unions. This programming language is under heavy development and I want to know if this comes as interesting to some of you. I'll try to post again on this subreddit if I got to bind Raylib game library to Cm1, allowing people to write Raylib games directly on their browser (works offline).

I know that programs that are written in C compiles fast already and there's even an existing compiler that is very fast (Tiny C Compiler). However, I'm the developer of Cp1 programming language (cp1-lang.org), which is a language that "transpiles" to C, and I aim to upgrade Cp1 by targeting the Cm1 language then compile it to bytecode in one command instead of a separate step in Makefiles or build scripts. This will make Cp1 very fast to compile for debug builds.


r/cprogramming • • Nov 22 '24

Am I stupid or is C stupid?

12 Upvotes

For the past few days I have been working and working on an assignment for a course that I am taking. It is in C obviously and involves MPI as well. The objective is to solver a 2D domain finite-difference problem. But everytime I run the code, how much I perfected it, it returned me an error. The residual was always going to infinity. Even, I handcalculated few steps just to be sure that I was writing the code correctly. None worked.
And tonight I finally found the culprit. The below code was breaking whatever I did.

#define PI        3.14159265358979323846
#define P(i, j)   p[j * (solver->imax + 2) + i]
#define RHS(i, j) rhs[j * (solver->imax + 2) + i]

But, the when I gave parentheses to the indexes, it worked. I have absolutely no fricking idea why this happens. I haven't touched any other line in the whole code but just this.

#define PI        3.14159265358979323846
#define P(i, j)   p[(j) * (solver->imax + 2) + (i)]
#define RHS(i, j) rhs[(j) * (solver->imax + 2) + (i)]

Can someone please tell me if there is functionally any difference between the two? I was honestly thinking of dropping the whole course just because of this. Every single person got it working except me. Although I didn't score anything for the assignment I'm happy to have found the reason :)


r/cprogramming • • Apr 20 '22

Any of you guys know a fun way to learn C?

0 Upvotes

I tried the old fashioned way and I feel bored with it. With all these apps, curious if there's any better ways to learn. Cheers


r/cprogramming • • Jan 12 '26

NEWBIE QUESTION

0 Upvotes

Im a first year Computer science student studying C programming language.
What sources are great when explaining the language in a beginner friendly way?
What are the natural progression when learning the language?
What are easy ways to learn the language?


r/cprogramming • • Sep 20 '26

Quelle library existe t-il pour le C pour avoire la stl de C++ ?

0 Upvotes

Bonjour,

je me demande quelle library il existe en C pour avoire des Array, vecteur, etc... générique donc comme en C++ qui as la stl si vous connaissez une library fiable je suis preneur ???

mercie à vous


r/cprogramming • • Mar 05 '26

CLI tool that explains C memory leaks and suggests fixes

Thumbnail
github.com
1 Upvotes

Hello everyone,

I've developed an open-source tool called Leax.

It's a CLI that acts as a Valgrind companion to help understand memory leaks in C programs.

Leax combines Valgrind, GDB-based tracing, and Mistral AI to:

- pinpoint the root cause of a leak,

- explain why it happens,

- and suggest a concrete fix.

The memory analysis itself is deterministic based on execution traces), while the AI is primarily used to explain the "story" of memory in your program in plain language.

It works well on classic C programs using malloc / free . There are still limitations in some cases (multi-process, etc.), and the tool is actively being improved.

If anyone wants to try it on their C projects, I'd really appreciate feedback and suggestions!

Thanks! 


r/cprogramming • • May 21 '22

help me with this program

Post image
0 Upvotes

r/cprogramming • • Feb 19 '22

WTH is wrong please help me I'm new to c programming

Post image
2 Upvotes

r/cprogramming • • Dec 05 '25

Can’t ai be built with c++

0 Upvotes

Why every time I start researching about how ai models are made they show me some python video isn’t it possible to make a ai model using c++ or JavaScript or any other language and make it more faster because c is more faster than python I think.


r/cprogramming • • Jul 25 '25

Legally Hacking Dormant Bitcoin Wallets in C

Thumbnail
leetarxiv.substack.com
2 Upvotes

r/cprogramming • • Jul 11 '25

C's mascot should be a Fancy Rat

4 Upvotes

Here is a mockup. Thoughts?


r/cprogramming • • Mar 13 '24

Shorthand for 00000000 00000000 when you are writing binary numbers?

1 Upvotes

Like, imagine you are writing a 32 bit number, and the right 3 bytes are all 0 or all 1. Is there some shorthand to indicate that the numbers are following or that the first byte is a power of... umm... 16 or something?

EDIT: Like, if you wrote 10110110 in a comment, but didn't have space for the 00s . I didn't mean as a real number that works in code. I know about FFs


r/cprogramming • • Jul 09 '22

why C is the best language for start in the world programming? 10 reasons..

1 Upvotes

r/cprogramming • • Dec 30 '25

Principle Of Least Concern

0 Upvotes

Hello there. I love the language and am by no means a newbie, having done many sorts of programs with it, been a few years.

For me, the language is almost perfect. Although, there are some things which bothers me by a lot, and I deny using something else such as C++. I like having only what is necessary, nothing more, so C with assembly is my way to go. I could not find resources online to solve my issue, so I need to resort to someone with more experience. Neither the llms are able to solve it.

The issue is the inability of one to use a principle, the principle of the least concern/visibility. The solution to this problem seems double: make more files or make do. And this makes me very much depressed.

Python, Java, C++ for example, all have features that enables the user to organize code within a single source file. They mainly solve the issue by proposing access modifiers. Please, know that I am not talking about OOP, this has nothing to do with OOP. Please, also know that one adheres to the gcc compiler and all it's features.

I already know how the language works, the only this I haven't used much in those years is the _Generic along with other more obscure features. But only having the ability to static global variables so they be localized in the object file, seems to not be enough.

One may wish to have a source file be made of various parts, and that each part have only what is needed to be visible. I talk like this because I assume this problem is well known and that you guys already know where I am going with this. But I argue that this makes prototypes, for instance, completely useless. Since I assume they are not useless, then there sure must be a way for one to apply the principle.

I will suppose that some of you may also contest my above affirmation. No damm shall be given about the traditional way of separating code into two files, put some prototype in one, definitions in the other, call one header, the other source, and call it a day. No. That's needless, unclean in my opinion and even senseless unless one may really find benefit at having an interface file for multiple source, implementation files. Since I don't mind using my compiler's features, there is no need to be orthodox.

I simply cannot fathom that one of the most efficient languages to cover assembly have been this way for so long and that no one bothered to patch it up. I have created parsers before, hence other languages. I state that the solution to this issue consumes 0 runtime. Not only that, the grammar will not be changed, but added upon, so the solution would be backward compatible with any other code written in the past. I guess as many have said it, it is like this due to historical reasons :/ and worse, I am incapable of changing the gcc source or even making a good front end with those features for the llvm. I can't compete with the historical optimizations.

To be more clear about the principle in the language, suppose a single source file with three functions for example, A, B and C. It is impossible to define them all in the same file such that A can call B, B can call C but A cannot call C. Sure you may with prototypes, but you cannot follow the pattern if I add more functions. One may do such a thing in C++ for example, using protected modifiers and having other structures inherit it, enabling one to divide well enough code without needing to create more files. One may extern the variable in C, which for the usage of the principle, should have other means to encapsulate the variables. Was it clear or would I need to further formalize the problem?

I assume you guys already know about this. According to me, this is the only issue that doesn't make C a scalable language :( Help


r/cprogramming • • Aug 22 '25

I did all theses projects at school 42

0 Upvotes

One year at 42 São Paulo and a lot has changed — I barely knew C when I started. After a year of learning, failing, and improving, I’ve completed all the projects below, some with bonus features:

➤ fdf — simplified 3D visualization
➤ ft_libft, ft_printf, get_next_line — the foundations of my personal C library
➤ minitalk — inter-process communication via signals (lightweight sockets)
➤ net_practice — network exercises (TCP/UDP)
➤ philosophers — synchronization and concurrency problems
➤ push_swap — a sorting algorithm focused on minimizing operations

All projects include demos and a README with instructions and explanations. You can check everything here: https://github.com/Bruno-nog/42_projects

I’m from Brazil and doing 42 São Paulo. If you find the repo useful, please give it a ⭐ on GitHub — and I’d love any feedback, questions, or requests for walkthroughs.

Cheers!


r/cprogramming • • Nov 04 '24

Could you make a memory eating program?

1 Upvotes

I'm thinking of a program that makes a bunch of double-type variables with random names and values.

Could that eat up a lot of memory? Potentially crash a computer?


r/cprogramming • • May 08 '25

Can anyone explain in easy words why putting or omitting the parantheses after (float) affects the result?

0 Upvotes

In the following code-

#include <stdio.h>

int main() {
    int x = 5;
    int y = 2;
    float result = (float) x / y;
    printf("Result: %.2f\n", result);
    return 0;
}

Result is 2.50 as I expected but in-

#include <stdio.h>

int main() {
    int x = 5;
    int y = 2;
    float result = (float)( x / y);
    printf("Result: %.2f\n", result);
    return 0;
}

Result is 2.00. I know that this is because precedence of parantheses is higher but doesn't the program first execute the (float) before the (x/y)? or is it because precedence is right to left?

If it is because of right to left, how would I get correct decimal results for equations like -

x*(y/(z+4))                  

Where x,y,z are all integral values. Taking account for the precedences.


r/cprogramming • • Aug 09 '26

Where to learn C program?

0 Upvotes

I want to learn C programming,plz suggest some good websites or youtube channels where I can learn C language.I prefer smtg that's similar to MOOC which is for python from university of Helsinki.Plz drop your suggestions


r/cprogramming • • Apr 20 '22

how to execute a exe file on a cp that doesn't have GCC installed ?

0 Upvotes

I've created a program that i would like to test on another computer. But the problem is that gcc(or g++) is not installed on that system. How do I integrate gcc into my code so that the .exe can run on the other pc without me needing to install a c++ compiler on it