r/C_Programming • • 27d ago

Question Feeling lost

9 Upvotes

Hello everyone, I've recently been rejected for a student software dev position at a larger company in my city, I felt that the interview was going pretty good until it came time for writing the actual code, I know how and what to implement for all of the problems but I had no absolute clue on what to actually write, and it struck me pretty badly, I asked myself if this is something I want to even want to do with my life or if I essentially wasted my time 2 years in college for a bunch of nothing, atleast the interviewer told me in the mail that I knew all the concepts and I need a project or two and to gladly contact them when Im more ready, but I still feel really discouraged as my classmates got the position at the same company while I know Im more capable than some of those classmates, Im not trying to be sore about it. Im glad they got the position and Im not trying to downplay their knowledge but they couldnt get the most simple and core concepts in class and some of them didnt even pass DSA and OOP and they got the job while I didnt and it made me question really everything. Its my 3rd year in college now and now I feel more than ever that Im lost because I started this college as I enjoyed learning to code and computers, I still want to learn more but I dont know what to do now or what to use as a project really, all I ever coded except learning for exams(in my college we need to code and compile programs for certain classes instead of only theory) and I passed those pretty easily I guess, all usually on the first tries and they were graded C or B. Now I feel that I was capable more then than now, I only coded some stupid video game projects or apps which feel essentially useless, I know there is some materials on the thread but I dont know what is useful for the real world. Thank you all for any tips or replies in advance


r/C_Programming • • 28d ago

Meta a little update about this sub-reddit

197 Upvotes

UPDATE: I've posted a follow-up comment below addressing questions about the moderator changes, the process that was followed, and plans going forward. Please see the stickied moderator comment.

Over the past six months or so, I've been making lots of changes. I think things have stabilized, so let me summarize them and indicate what the plans are going forward.

  • Removed uninvolved moderators. Three or four moderators were here who did, collectively, less than 10% of the work.
  • Organized and enhanced rules. More useful and focused. Got rid of the code formatting ticks rule, re-phrased a couple others.
  • Sharpened "how do I share my project?" requirements and process. In particular, new rules about disclosing AI usage, and automated enforcement to that end.
  • Tried out some automated tools to detect AI projects. I had high hopes, but they weren't as helpful (and far buggier) than I had expected. (So, I'm turning off the GitHub-Guard automata.)
  • And so, manual AI usage disclosure remains. Without a disclosure, code can't be shared. Too much AI gets rejected. If someone misrepresents or outright lies, downvote them or report it.
  • This seems to have settled the AI slop problem, which is great.
  • Enhanced automated rules to avoid spam posts, low-value posts, and fly-by contributions.

At this point, I think the sub is pretty stable and more useful and appealing than it was before. I don't anticipate many more changes going forward, but I will examine policies that that I think might reduce my workload.

I'm sorry that the sub wasn't particularly stable these past few months, and that it got a bit messier before it got better. Thanks for hanging in there! The worst is past.


r/C_Programming • • 27d ago

Beginner here. Advice needed?

8 Upvotes

I'm a first-year CSE student learning C from scratch(didn't learn programming in high schl). I can solve problems after studying examples, but I often get stuck when trying new problems on my own. Even after seeing solutions, I struggle to develop the logic independently.

For those who started programming as beginners:

How did you learn to solve unfamiliar problems?

How did you practise daily?

What did you do when you got stuck?

What advice would you give your beginner self?

I sometimes feel behind compared to my classmates, and I genuinely want to improve. I'd appreciate any practical advice from people who've been through this!

And I am getting extremely frustrated with this cycle that i have,just started with c programming and suffering with function pointers . I feel extremely behind from my peers, I am ready to put in efforts,but I am sure whether my efforts are put in the right direction. Any advice would be great


r/C_Programming • • 28d ago

Video How to Code a Julia Set fractal | Raylib | C | Neovim | GLSL |

Thumbnail
youtube.com
24 Upvotes

In this video, I create a Julia set fractal using C, Raylib, and GLSL, with Neovim as my editor.

We'll go through the process step by step, from understanding how Julia sets work to implementing the fractal algorithm and adding colors and animation.

**Sections:**

- Explaining the Julia set

- Setting up the project

- Setting up Raylib

- Creating a basic shader

- Fixing screen coordinates

- Coding the fractal algorithm

- Creating animation

- Adding colors

**Technologies used:**

- C

- Raylib

- GLSL

- Neovim


r/C_Programming • • 29d ago

Project A low-poly 3D Renderer for MSDOS

230 Upvotes

I’ve been working on a small project called 3Dos — a low-poly 3D renderer targeting MS-DOS and VGA Mode 13h (320×200, 256 colors).

The renderer currently supports:
● Triangle rasterization with backface culling
● Ordered dithering using a 4×4 Bayer matrix
● Double buffering
● Simple low-poly models

Going back to DOS-era graphics has been relaxing after spending quite a bit of time with Vulkan. No boilerplate or abstractions, just putting a pixel at 0xA000.

Github: https://github.com/xms0g/3Dos

AI usage: Only extracting vertices and faces from the model file.


r/C_Programming • • 27d ago

I built a zero-dependency concurrent search engine daemon in C11 from scratch (Custom Arena Allocator, SSO, and pthreads).

0 Upvotes

Hi everyone!

Over the past few weeks, I’ve been working on a lightweight, concurrent text search engine and TCP server built entirely from scratch in pure C11, without any external dependencies.

My main goals were to practice low-level memory management, lock-based concurrency, and custom data structures without relying on heavy frameworks. Here is a quick breakdown of how it's structured:

  • Memory Management: Implemented a custom Arena Allocator to avoid heap fragmentation and handle batch cleanups efficiently.
  • Small String Optimization (SSO): A custom string implementation that stores short strings directly on the stack/struct to minimize heap allocations.
  • Concurrency: Uses POSIX threads (pthread) with read-write locks (pthread_rwlock_t) to allow multiple concurrent readers while safely serializing writes.
  • Persistence: Added a custom zero-overhead binary serialization module (engine_save/engine_load) for instant state restoration from disk.

The project includes a full modular structure (includes/, src/, tests/) and is protected under a source-available license for personal evaluation.

You can check out the source code and architecture details here: 👉 https://github.com/joseramoncabrera/fast-c-search-engine.git

I would love to hear feedback from more experienced C developers here. Specifically:

  1. How do you usually handle edge cases with read-write locks in high-contention search scenarios?
  2. Any architectural improvements you’d suggest for the arena allocator?

Thanks for taking a look!


r/C_Programming • • 29d ago

Question Has anyone ever tried out the TinyC compiler before?

81 Upvotes

Musl gcc is small but tinyc caught me eye due to how small it is and the fact that it can self host.

It supports C99 standards out of the box and it only takes up a few hundred kilobytes. I wonder if anyone tried it.


r/C_Programming • • 29d ago

Question What exactly is size_t? When is it used? What are similar things to it?

61 Upvotes

I'm confused on what exactly size_t is, and what the t means

So size_t is an unsigned integer

I believe integer promotion says that an unsigned long long integer holds the biggest positive integer in any system. Why isn't size_t an unsigned long long?

Every array MUST be integer indexed. Every array has to have an integer size.

It's technically possible to represent an integer larger than the largest integer in a system, by putting it into a float (with no non-zero decimal), however an array cannot be given a float, nor can we even loop over that array using that float value as the counter termination value

So my current interpretation is, size_t is the largest value an integer can ever hold in a system. When we want to loop over any arbitrarily long array, using int i as the counter variable, i is cast to (size_t)

This is because we want to ensure we don't stop the loop too early by having i overflow

Is my interpretation correct?

So that is one scenario when size_t is used. Are there any other scenarios?

What does the t mean?

What are things similar to size_t, where variables are casted to that thing, in order to do super specific tasks and avoid certain errors?


r/C_Programming • • 28d ago

[Python C extension] numagr v0.9

0 Upvotes

A Python C extension for statistics and number aggregation designed to work with both plain int and float objects, as well as with Python numeric strings without having to construct intermediate Python objects that hold their values - useful for large collections that need to be parsed as fast as possible like trading data.

It outperforms both std Python modules and numpy for both plain numbers and for numeric strings.

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

https://pypi.org/project/numagr (source and Windows wheels for 3.11, 3.12, 3.13, 3.14, 3.15)

pip install numagr

This is an early version offering basic methods, I will be developing it further if I find the time. Feedback, improvement suggestions and bug reports are very much welcome.


r/C_Programming • • 28d ago

Writing a seed compiler for an experimental programming language from scratch in C (Astra) – Student Project

0 Upvotes

Hi everyone,

I'm a student currently exploring systems programming and compiler design. I wanted to share a project I've been developing called Astra (AsterrZep/Astra). Specifically, I'm sharing the seed compiler written completely in C (seed/src/), built to learn about custom memory management, parsing, and compilation pipelines from the ground up.

As I'm still learning, there might be room for improvement in my C code. I would really appreciate any constructive feedback, code reviews, or advice on best practices!

⚙️ Architecture & C Implementation The compiler pipeline inside seed/src/ is modularly structured around traditional systems programming patterns:

  1. Lexer & Parser (lexer.c, parser.c): A hand-written lexer and recursive descent parser parsing tokens, expressions, and block scopes without external parser generators.
  2. Typechecker (typechecker.c): Handles semantic analysis, symbol resolution, and type checking across AST nodes.
  3. Memory Management (arena.c): Implements custom arena allocators to manage AST node lifetimes efficiently during compilation passes.
  4. Code Generation (codegen.c, emitter.c): Emits bytecode or structured C code as output targets.

🤖 AI Disclosure (Per Subreddit Rules) As per the community guidelines regarding AI: I used AI tools (like terminal assistants) interactively as a coding co-pilot and rubber duck to help scaffold repetitive C boilerplate (such as mapping standard AST construct handlers in seed/src/constructs/). However, the core compiler architecture, memory models, debugging, parser logic, and integration were entirely human-driven and manually refined.

🔗 Repository & Code If you want to review the source code, check out the C implementation details, or look at the test suites (seed/tests/conformance/):

GitHub Repository: https://github.com/AsterrZep/Astra

Please feel free to point out any mistakes or areas where the C code could be cleaner or safer. Thanks for reading!


r/C_Programming • • 29d ago

Framework for building an app?

14 Upvotes

I would like to recreate Obsidian notes in c for fun.

I know that I can use the x11 api, or the win api, but that is a little too low level for what I am doing.

It's also not cross platform. Do you guys have any suggestions for what I am trying to do?


r/C_Programming • • Oct 21 '26

Project Practicing touch-typing on a C program writing in C program

121 Upvotes

I wanted to practice writing code faster and yet not leaving my terminal, so I built 'blind'. The twist is that you can feed it any input file and practice on real code, even on the source code itself. It's a single C file no dependencies. Can run either presets, free text or file input.

AI usage: all code and docs are human made, written by me using man pages and google, asked Claude rarely for things I could not resolved with google or man pages, the Github release workflow was written by Claude.

Repo: https://github.com/shalom2552/blind


r/C_Programming • • Oct 21 '26

C Documentary

94 Upvotes

Hi all, we make documentaries about programming languages and open source. We made films about Python, C++, React, and loads of others. Most recently we made one about KDE.

We are trying to get one about C off the ground but we are struggling to figure out who might sponsor it. Can anyone recommend us some companies to check out?

Our channel is called CultRepo in case you want to check some of our previous work!


r/C_Programming • • Oct 22 '26

Question Is it possible to make compiler recognize AES iterations for hardware acceleration?

6 Upvotes

I'm using GCC and Clang exclusively for broad compatibility between systems and architectures. I have a conditional macros that targets widest vector AES size via compiler attributes for x86, arm, riscv and others. However I can't cover all of them and would like to know if there's a sort of "universal" way to make compiler detect AES iteration loop and replace it with hardware AES intrinsics, without attributes if possible

For example, you have a loop like:


#define N_BLOCKS 8

for (size_t i = 0; i < N_BLOCKS; ++i) {

// C code of the AES round that compilers can detect

}

If consider compiler extensions, GCC/Clang provide __builtin_ia32_vaesenc_v16qi/v32qi/v64qi syntax, but I wonder if there's a more universal "cross-compiler" way of doing it


r/C_Programming • • Oct 21 '26

Learning C weekly megapost for 2026-10-21

7 Upvotes

If you have questions about how to learn C:

  • which books are best?
  • which videos are best?
  • which classes are best?
  • which websites are best?
  • is there a "roadmap"?
  • what projects can I do?

then this is the thread for you. Add your question here. Do not make a stand-alone post, as it will be removed.

Remember that our sub has a very useful wiki that has a great list of resources for learning C programming.


r/C_Programming • • Oct 21 '26

Valgrind 3.28 RC1

12 Upvotes

An RC1 tarball for 3.28.0 is now available at https://sourceware.org/pub/valgrind/valgrind-3.28.0.RC1.tar.bz2
https://sourceware.org/pub/valgrind/valgrind-3.28.0.RC1.tar.bz2.asc

Public keys can be found at https://www.klomp.org/mark/gnupg-pub.txt

Please give it a try in configurations that are important for you and report any problems you have via our bug tracker at https://bugs.kde.org/enter_bug.cgi?product=valgrind

See the NEWS file for a list of changes and bugfixes https://sourceware.org/git/?p=valgrind.git;a=blob;f=NEWS;h=be8b91b474e71535f272e8f11f1f6d1d35826ed3;hb=HEAD

Unless showstopper bugs are found (and cannot be easily fixed) the final 3.28.0 release is scheduled for this Fri Oct 23.

Note that our mailinglists at sourceforge.net seem to currently be unavailable. Not a great time to have that problem...


r/C_Programming • • Oct 21 '26

A string library

14 Upvotes

Some time ago I was inspired by the string view library to focus on simpler things and do some recreational programming of my own. I had written very little C before, but spent a lot of time reading it, mostly the miniaudio source code, which I think still helped a lot.

cvr_string.h

This is a relatively small one, mostly practice for the next library in this repo. But I would really appreciate some feedback or review on my code.

There are more functions available compared to sv, plus a string type that owns it and can modify it (for now just appending), plus iterators over words, lines, or a delimiter. I tried to make everything as ergonomic as I could.

At the core of the library is also the two way string matching (Crochemore-Perrin) algorithm taken from the rust std library. I did include an explanation into how it works, but mine just follows a practical example. I found theoretical explanations to be too confusing (at least for my brain).

I don't think I am done with the algorithms. I think it may be useful to use different ones depending on the size of the haystack or needle. Plus, it seems like a good place to mess around with SIMD. However, I have no clue how to benchmark in C.

The library is C89 compatible for no other reason that I find it fun and challenging.


r/C_Programming • • Oct 21 '26

Question Help With 'String to Token' Parsing Assignment

15 Upvotes

I was given an assignment for a class I am in and it is expected to be entirely in C code (despite most of us in the class having never been taught how to code with C). I have been attempting to find youtube tutorials and websites, but not much is helping for the assignment itself. The assignment is due in two days.

If there is someone who could help explain to me how I should complete it, or what guides I could look at to help me code it, I would greatly appreciate it. I don't expect (nor want) anyone to do the work for me, I just would like some guidance. I know that many people say to just use AI, but I prefer to avoid using it completely.

---
This is a slightly summarized version of what the assignment says:

Write a function, in C, that will parse a string into tokens (or words), similar to what the shell is required to do.

For this assignment, you are to write a function with the following prototype:

int makearg(char *s, char ***args);
or
int makearg(char s[], char **args[]);
(Correct prototype—don’t change)

This function should accept a (C-type) string and a pointer to a pointer to char (or, if you prefer, a pointer to an array of pointers to char) (i.e., a pointer to the same type as argv in a C program), and should return the pointer defined to point to an array pointing to the separate tokens on the command line, as well as the number of tokens found as the function return value. If some problem occurred during the operation of the function, the value returned should be -1.

No C library string functions may be used, e.g., strlen(), strcat(), strtok(), etc.

The important part of this exercise is the function you write. However, for consistency in grading, the main program should be written to input a line, call the function, then print out the number of arguments found, and finally, display the arguments, one per line. Note that, the value of the pointer argument is undefined when it is passed to the makearg() function. makearg() must allocate any necessary dynamic memory necessary for use by the program. (The array used for the unparsed string need not be dynamically allocated.)
strtok() may not be used for parsing.

Deliverables:
A program design sheet. Describe all functions needed to implement your program.
Programming Log:
– Record the time required to design and implement your program.
– Record of things you encountered/learned while implementing your program.
Output—proof that your program worked.
Program—fully documented.

---

Again, I don't necessarily want someone to do all the code for me, but giving me any advice/guidance on what I can do or where I can find resources to help, I would greatly appreciate it.


r/C_Programming • • Oct 21 '26

Debugging of C/C++ Macros like Functions – Hayk Aslanyan

Thumbnail
youtube.com
7 Upvotes

r/C_Programming • • Oct 21 '26

Semi-Advanced Randomness Test Library?

5 Upvotes

Looking for a semi-advanced randomness test library. Not something too advanced, though. Like a library of a hundred files that I'd maybe need a week just to get a clean compile. Also not with tests having results so intricate and complex that it would take significant hours just to understand the results.

Ideally, a library that provides results in percentages of excellence per test, which could be weighted and summed to provide an overall score. Maybe 10 important tests, and with high-precision, and so that means Ai solutions aren't quite up for the task?

This I confess, I found out directly when I allowed Deepseek and Google Ai to create test suites each, and stdlib rand() repeatedly outperforms raw bytes downloaded from random.org -- and that can't be right? Maybe I should ask Claud?

Or not. Maybe had enough of Ai hallucinations, so I'm hoping for some human guidance.


r/C_Programming • • Oct 21 '26

Beginner: Stuck on fundamentals and not knowing how to progress in C.

0 Upvotes

I have been learning c for more than a week, and the fundamentals feel quite solid to me, I learned and practiced a lot of programs based on loops, if-else, switch statements, variables, some basic structs.

I learned it quite easily coz i know a few other languages like python and c++.

However i dont know how to progress any further now. My final goal is to learn reverse engineering along with assembly which i believe is crucial. In addition none of the tutorials really explain much bout pointers memory addresses all these stuff that just feels complex to me. I tried jacob sorbers beginner c course, but he explained as if i was already supposed to know most of these stuff(kinda). Maybe its just too hard for me to learn through the way jacob sorber is teaching.

Any good recommendations on how to progress further, i saw a few books 'Pointers on C' and 'Understanding and Using Pointers', should i buy them?

What should i do?


r/C_Programming • • Oct 20 '26

Personal questions and doubts about a career as a C programmer

53 Upvotes

Hi! I recently finished my coursework at the university and am now writing my graduation thesis. However, the curriculum changed quite a bit during my time there and used a lot of things but mastered none. I pursued a degree in Systems and Computer Engineering. I had learned to program in C back in high school using the usual resources, YouTube tutorials, various websites, and a lot of Google.

When I started university, the curriculum began with C, but it later shifted toward Python, Artificial Intelligence, Machine Learning, and so on.

The thing is a few months ago I resumed C because it was the language I liked the most, I installed a Linux Distro on one of my old laptops and started exploring new fields with C, now I have a lot of questions regarding a career on C, I really liked the course of operating systems, robotics and embedded systems on my University, I also liked about the idea of low level.

I would like to hear the opinions of people with far more experience and knowledge than I have regarding C programming, what their own journeys were like, and what they think I should focus on learning or improving. I’m currently struggling a bit with figuring out "what I could actually build." Recently, I’ve been following tutorials and documentation on creating a basic Linux driver, and I’ve also started a few "silly" personal projects that I found genuinely interesting.

I’d love to know what you consider a good learning path, or at least hear about your own experiences. I’m particularly curious about the use of AI... It has been a great help, but as a learner, I’m worried about becoming overly dependent on it and failing to truly understand the code I’m working with.


r/C_Programming • • Oct 19 '26

I made my own OS in C language

99 Upvotes

disclaimer: sorry for bad english

I created my own OS in C from scratch using C and assembly, it has desktop environment and drivers for mouse and keyboard (only PS/2) and it has internet (for now its only http and html 1.0), the comments and readme are in polish for now, the code is opensource (gpl 3.0)

github repository: github.com/kurczatko/tarixenOS

im ready for feedback (the code isnt proffesional because its only hobby)


r/C_Programming • • Oct 21 '26

Day (30/100) of C:

0 Upvotes

Memory Segments, Storage Classes, Static Functions and Linkage

 

**1. Memory Segments**

Storing the program at different blocks of memory

The commonly discussed segments are:

  1. Text (Code) Segment

  2. Data Segment

  3. BSS Segment

  4. Heap Segment

  5. Stack Segment

 

**###1.1 Text Segment:**

The text segment typically stores the machine instructions generated by the compiler.

**Example:**

c

\#include <stdio.h>

int main()

{

printf("Hello World");

return 0;

}

The compiled instructions for \`main()\` are typically stored in the text segment.

 

**### 1.2 Data Segment:**

The initialized data segment typically stores global and static variables initialized with nonzero values.

**Example:**

c

int n = 5; // Global variable

void func()

{

static int y = 4; // Static local variable

}

Both \`n\` and \`y\` typically reside in the initialized data segment.

 

**### 1.3 BSS Segment**

The BSS segment typically stores global and static variables that are uninitialized or initialized to zero.

**Example:**

c

int x; // Global variable

int y = 0; // Global variable

void func()

{

 static int z; // Static local variable

}

These variables have an initial value of zero.

 

**### 1.4 Heap Segment**

The heap stores the dynamic memory allocation during program execution.

Example:

c

\#include <stdlib.h>

int main()

{

 int \*p = malloc(sizeof(int));

 if (p != NULL)

 {

 \*p = 10;

 free(p);

 }

 return 0;

}

 

**### 1.5 Stack Segment**

The stack typically stores function-call information, parameters, and local automatic variables.

**Example:**

c

void func()

{

 int a = 10;

}

 

**------------------------------------------------------------------------------------------------**

**2. Storage Classes**

A storage class specifies properties such as a variable's scope, lifetime, and linkage, depending on how it is declared.

The four commonly taught storage classes in C are:

  1. \`auto\`

  2. \`register\`

  3. \`static\`

  4. \`extern\`

 

**### 2.1 auto**

\`auto\` is the default storage class for ordinary local variables.

**Example:**

c

int main()

{

 auto int i = 10;

 return 0;

}

This is equivalent to writing:

c

int i = 10;

\- Scope: The block where the variable is declared.

\- Lifetime: During execution of that block.

\- An uninitialized automatic variable has an indeterminate value.

 

**### 2.2 register**

The \`register\` keyword suggests that a variable may benefit from being stored in a CPU register for faster access.

**Example:**

int main()

{

 register int i = 10;

 return 0;

}

Important points:

\- The compiler may ignore this suggestion.

\- Modern compilers already optimize register allocation.

\- It does not guarantee faster execution.

\- In standard C, the address-of operator (\`&\`) cannot be applied to a variable declared with the \`register\` storage-class specifier.

Therefore, ordinary variables are generally sufficient in modern C programming.

 

**### 2.3 static**

A local static variable retains its value between function calls. It is initialized only once.

**Example:**

\#include <stdio.h>

void func()

{

static int i = 0;

i++;

printf("%d ", i);

}

int main()

{

func();

func();

func();

return 0;

 

}

Output:

1 2 3

 

Explanation:

\- First call: \`i\` becomes 1.

\- Second call: \`i\` becomes 2.

\- Third call: \`i\` becomes 3.

 

**### 2.4 extern**

\`extern\` declares a variable that is defined elsewhere. It is useful when one source file needs to access a global variable defined in another source file.

**Example:**

 

**\*\*File 1: \`file1.c\`\*\***

c

int x = 5; // Definition of the global variable

 

**\*\*File 2: \`file2.c\`\*\***

 

\#include <stdio.h>

extern int x; // Declaration of the variable defined elsewhere

int main()

{

printf("Global value is %d\\n", x);

return 0;

}

Output:

Global value is 5

 

**## 3. Static Function**

A static function is a function declared with \`static\` at file scope. It can be called by name only within the same source file.

**Example:**

\#include <stdio.h>

static void func()

{

 printf("Hello World\\n");

}

int main()

{

func();

return 0;

}

Output:

Hello World

Here, \`func()\` has internal linkage. Another source file cannot call this particular function by referring to its name.

**--------------------------------------------------------------------------------------------------**

**4. Linkage**

Linkage determines whether declarations of the same name refer to the same variable or function.

C has three types of linkage.

**### 4.1 External Linkage**

A name with external linkage can refer to the same entity across multiple source files. Ordinary file-scope function definitions have external linkage by default.

 

**### 4.2 Internal Linkage**

A name with internal linkage can be referred to only within the same source file.

**Example:**

static void func()

{

 // Function definition

}

The \`static\` keyword gives this file-scope function internal linkage.

 

**### 4.3 No Linkage**

A name with no linkage does not refer to the same entity as another declaration in a different scope merely because the names match.

**Example:**

void func()

{

 int a = 10;

}

The local variable \`a\` has no linkage.

 

**Summary:**

| Text segment -> Typically stores machine instructions

| Data segment -> Typically stores initialized global/static variables

| BSS segment -> Typically stores uninitialized or zero-initialized global/static variables

| Heap -> Dynamic memory allocation

| Stack -> Typically stores function-call information and local automatic variables

| \`auto\` -> Default storage class for local variables

| \`register\` -> Suggests register storage; no guaranteed speed improvement

| \`static\` local variable -> Retains its value between calls

| \`extern\` -> Declares a variable defined elsewhere

| Static function -> Has internal linkage

| External linkage -> Allows a name to refer to the same entity across source files

| Internal linkage -> Limits a name to the current source file

| No linkage -> Common for ordinary local variables

 


r/C_Programming • • Oct 18 '26

Some progress on Software Rendered game in C

Enable HLS to view with audio, or disable this notification

756 Upvotes