</>
ShikshaCSLearn. Code. Grow.
🔍
☕ Support Us
ShikshaCSNotesProgramming in C
Programming in C
🕒 6 min read

Introduction to C & Compilation

What C is, why it's still taught first, and how your code becomes a running program.

What is C?

C is a general-purpose, procedural programming language created in the 1970s. It gives you direct control over memory, which is why operating systems, compilers, and embedded systems are still written in it. Learning C first builds a strong foundation for every other language, because it forces you to think about memory and execution instead of hiding it behind abstractions.

The Compilation Process

Your .c file goes through 4 stages before it runs: Preprocessing (handles #include, #define), Compilation (converts code to assembly), Assembly (converts to machine code/object file), and Linking (combines object files + libraries into the final executable). Each stage can be run separately using gcc flags (-E, -S, -c) if you want to inspect the output.

#include <stdio.h>

int main() {
    printf("Hello, ShikshaCS!\n");
    return 0;
}

Why Learn C First?

C forces you to understand memory, pointers, and how a computer actually executes instructions — concepts that stay hidden in higher-level languages like Python or JavaScript. Once you understand C, other languages feel easier because you already know what's happening 'under the hood'.

🌍 Real-World Use

Linux, Windows, and Android's core (kernel) are written mostly in C. Every time your phone boots up, C code is running underneath. Microcontrollers in cars, washing machines, and IoT devices also run on C because it's fast and needs very little memory.

💡 Pro Tip

Always compile with warnings turned on: `gcc -Wall file.c`. Most beginner bugs (uninitialized variables, mismatched types) show up as warnings before they become confusing runtime crashes.

🧪 Quick Self-Test

Check what you just learned — no pressure, just practice.

1. Which stage of compilation converts C code into assembly?

2. What does #include do?

← Back to all Notes