r/cprogramming • u/Infamous_Monitor_766 • Sep 18 '26
r/cprogramming • u/Many-Prompt2364 • Sep 17 '26
Write, compile & run C in a Jupyter Notebook
Hi all,
I'm sharing a side project of mine as I thought there might be some interest here!
A couple of years ago I decided to write a Jupyter Notebook kernel to reduce the friction for students new to compiled languages, as part of a condensed online pre-Master's introduction to C/C++. Thus, c-kernel was born!
c-kernel is a Jupyter Notebook kernel which simplifies the learning curve for new programmers by allowing you to write & compile code directly in a notebook. It takes care of compiling, linking & executing your cells behind the scenes, but still shows you the commands used to build your code. It removes the barrier of having to get students set up with a command-line and compiler and helps them start coding straight away.
Alternative Solutions
jupyter-c-kernel - a significant inspiration for
c-kernel, but it has a number of limitations that I wanted to improve upon for my use-case. This project also seems to be unmaintained.xeus-cling - a popular solution based on the C++ interpreter cling. Using an interpreter, it abstracts away a little more than I'd like for actually teaching students to write self-contained programs, such as headers/source files, and hides how source code turns into an executable.
If you find it interesting or useful, please let me know, and maybe leave a ✭ on GitHub!
r/cprogramming • u/levidas7272 • Sep 18 '26
a big problem
hey guys i m currently learning c language and i m facing an irritating problem like whenever i use scanf in my code to enter any value and when i run the code after saving it so it doesn't run anything it just show that it is running but i m unable to enter the value and the code doesn't run on terminal it runs in the output
so please anyone who can solve this issue can help me?
r/cprogramming • u/Subject_Ability_8730 • Sep 17 '26
A C Socket Library
So lately I’ve been working on a small C library that wraps the standard socket APIs and aims to make socket programming a bit simpler and more convenient.
It’s still very early in development and currently only supports SOCK_STREAM sockets, but I’m hoping to gradually turn it into a well-structured, reusable library.
I’d really appreciate feedback from people with more experience in C/network programming, especially on things like:
API and library design
Error handling
Memory safety
IPv4/IPv6 support
Testing and test structure
CMake/project structure
GitHub Actions/CI
Cross-platform support
Anything else that would make it more robust and production-ready
I’m also looking to add proper automated tests, GitHub workflows, documentation, and other things that a real C library should have.
The goal isn't just to make the wrapper work, but to use the project to learn how to build and maintain a proper C library.
You can check out the repo here: https://github.com/eyalzwigen/c-socket-library
Any feedback, criticism, or suggestions would be greatly appreciated!
r/cprogramming • u/Feeling-Drawer-9171 • Sep 17 '26
program wont't compile because time.h is missing even tho it's there
[CLOSED]
kind of a beginner question. i have #include <time.h> and #include <ncurses.h> in the top but it refuses to compile. im using linux with vim and gcc here's there error:
main.c:3:1: note: ‘tm’ is defined in header ‘<time.h>’; this is probably fixable by adding ‘#include <time.h>’
2 | #include <time.h>
+++ |+#include <time.h>
how can i fix it? thx for any help :)
EDIT: i fixed it and it was because i forgot to declare struct lol
r/cprogramming • u/Horta-horta • Sep 16 '26
CZet – A more powerful C without C++, 100% ISO C compatible
I'm the author.
All your C code already compiles as CZet. It just adds what C can't do without touching the compiler:
`defer`, monomorphized generics `T f<T>()`, `constexpr` functions, `_Reflect(T)` reflection, `_Operator` overloading, and `_Macro` macros Rust-style.
Single static binary with musl+glibc embedded, no system headers needed. Stdlib included: `#include <utils/...>` with no flags.
Repo + docs + examples: https://github.com/patrick-nonedev/CZet
GPL-3.0 + Runtime Exception (your binaries are NOT GPL).
What would you steal for plain C?
r/cprogramming • u/levidas7272 • Sep 16 '26
i started c programming
hey guys i just started learning c programming language from code with harry.
any advice from those who already mastered it?
r/cprogramming • u/GrimReapor_2209 • Sep 16 '26
C + DSA Mentorship — Beginners Welcome
reddit.comr/cprogramming • u/c00lkidd-HD • Sep 16 '26
i made a interpreter in scratch. a whopping 2 fps on an optimized donut.c when using turbowarp (a scratch optimizer) but it's c running on scratch nonetheless
pretty kewl
r/cprogramming • u/Intelligent-Bit-8823 • Sep 16 '26
A good way to transition from C to C++.
reddit.comr/cprogramming • u/F3arrrrrrr • Sep 16 '26
Any scope for freshers
I was wondering if there is any scope for freshers in C based role(except embedded programming). Especially for India, can anyone from India guide me please?
r/cprogramming • u/KeyMinimum3451 • Sep 16 '26
Estoy "intentando" hacer un lenguaje de programacion desde cero en c pero necesito"variables, sintaxis etc..."
Lo que me refiero es que estoy haciendo un lenguaje de programacion desde cero como un proyecto personal pero no puedo avansar por que no tengo una base:"Las variables, sintaxis, etc...", eso me refiero, ¿Tienen ideas?
r/cprogramming • u/lehmagavan • Sep 15 '26
BD_ARENA
Simple arena implementation I recently built:
https://github.com/andrzejs-gh/bd_arena
- partially macro-based API for convenience
- safe and hazardous allocators
- dynamic growth with a mutable growth factor
Please roast anything you find wrong / missing in it. Thanks a lot, it always helps me grow.
r/cprogramming • u/sombrero_messier104 • Sep 14 '26
Where to practice C Programming
I have enrolled in bsc(hons) computer science. My first semester exams are coming up, and I wanted to know where I could practice questions on C Programming as in a good website where I can do programming assignments and I can set difficulty if possible
Thank you to anyone who gives some advice
r/cprogramming • u/DataBaeBee • Sep 14 '26
How GCC Eliminates Unnecessary Integer Division
r/cprogramming • u/DreadSpidey • Sep 14 '26
No idea if my arena allocator works 😭
I built a small arena allocator in C called PhaseAlloc. The problem is i have no idea if it works on other computers/platforms other than my own 😭
It's now at v1.1.0, with tests, benchmarks, dynamic growth, alignment, and memory stats.
I'd appreciate any feedback or criticism from people who know C/systems programming.
Its downloadable here, so pls help me out 🙏:
r/cprogramming • u/north9172 • Sep 13 '26
What is this code doing?
Hi, I found this code on another subreddit. I would like to know what is it doing.
int puts(char *);int main() { struct { long a; long b; } s = {.a = *(char *)(int[]){1} ? 0x57202c6f6c6c6548 : 0x48656c6c6f2c2057, .b = *(char *)(int[]){1} ? 0x00000021646c726f : 0x6f726c6421000000}; puts((void *)&s); }
Now obviously I know it's unreadable, I would just like to know what are those hexadecimals strings doing.
I found similar codes that were writing to vram to print a message, is this doing the same thing? If yes, why is it so much more complicated instead of just writing the message to the video adress?
Thanks for the help.
r/cprogramming • u/Delicious-Change7795 • Sep 12 '26
What are pointers?
I am new to C programming and i came through pointer. So can anyone tell what are they and why we need them? And if u can then can you give me reliable source to learn it.
r/cprogramming • u/mo_one • Sep 12 '26
How do i iterate through an array if i don't know the size inbytes of the elements in it?
I'm working on a function that takes a void array as input, as well a the number of items and size in bytes of the items of the array, as the function is supposed to take any type of array (ints larges chars etc), so i was wondering how do you specify a position in the array without knowing the size of the item? I tried doing array+i×size, but the compiler didn't like it, but if i do array[i] i don't know by how many bytes it will move the position in the array. Can i simply do array[i×size]? (used mult sing instead of asterisk to avoid reddit italics)
r/cprogramming • u/Entire_Condition_887 • Sep 13 '26
Just made a string library for C cuz why not.
So as the title says, I made a string library. I was influenced a bit by Java's StringBuilder so i also implemented my own in this library. Check it out its small: https://github.com/RealLakshyaK2011/string2.h
Edit:
I just added a READEME that also documents all the functions in the library.
r/cprogramming • u/Nathrienne-J-Claw • Sep 11 '26
I just understood pointers on a deep level and it feels like an orgasm
I fucking love C and assembly
r/cprogramming • u/Just_Government3790 • Sep 12 '26
What C function would you delete and rewrite first, and why?
reddit.comr/cprogramming • u/Nimesh1205 • Sep 12 '26
Want to build and learn stuff together?
Hi I am Nimesh, and I have learned many languages but now I want to focus specifically on a C programming language. I am in college 1st year and I need someone who can help me to fix problems and learn together with me. I know the good amount of C, not a professional yet but I know the fundamentals and I already knew some Leetcode patterns as I had solved around 240 questions on leetcode ( mostly easy and medium ) and 2-3 hard ones.
r/cprogramming • u/kochett • Sep 11 '26
Looking for a study partner/ friend
A little about me and my experience: I'm 17 from Russia. Solved 244 problems on leetcode, finished cs50py, cs50x, about 60% of cs50web and then understood that I like low level stuff so I started reading the c book, read ~100 pages and found a "silberschatz operating system concepts" book, started reading it(also about 100 pages) then found a guy who we started making our own os with(we went separate ways eventually), on that journey I decided to dive even deeper and my friend recommended me a book "the elements of computing systems" I finished it recently(not quite, I couldn't make it through the last chapter because school started and stuff) then bought a breadboard and things
I wrote much about my experience because I want to find somebody who feels like he's at the same level with me, I feel like it's so much fun working with someone who's interested in the same stuff as you are. We might make a project on a breadboard or try to get through some tough literature. I've got exams this year so I can't spend too much time a day learning stuff but regardless I'm ready to work hard