Loading Page Content...
Preparing courses, live labs, and learning resources.सामग्री लोड हो रही है, कृपया प्रतीक्षा करें...
Preparing courses, live labs, and learning resources.सामग्री लोड हो रही है, कृपया प्रतीक्षा करें...
Unlike interpreted languages like Python or JavaScript, C is an ahead-of-time (AOT) compiled language. Before your computer can execute a .c source file, it must be transformed into binary machine code through a strict 4-stage compilation pipeline.
gcc -E)The preprocessor scans the source file and handles all lines beginning with the hash symbol (#):
#define macro instances with their values.#include <stdio.h> with the actual contents of the header file.//) and multi-line (/* */) comments.#ifdef, #ifndef, and #endif guards.Command to inspect:
gcc -S)The compiler takes the preprocessed .i text and converts it into hardware-specific Assembly Language (.s):
Command to inspect:
gcc -c)The assembler translates human-readable assembly instructions into raw Object Code (machine code binary .o / .obj):
printf) unresolved.Command to inspect:
gcc -o)The linker combines your object file with standard C runtime libraries (libc) and other object files:
printf actually lives in the compiled C library).main.exe on Windows, main or a.out on Linux).Command:
- A) Compiler - B) Preprocessor (Correct) - C) Linker - D) Assembler
- A) .i - B) .o - C) .s (Correct) - D) .exe
Continue learning with hands-on practice, examples, and exercises in the upcoming topic.
| Previous Lesson | Next Lesson |
|---|---|
| History and Evolution of C Programming | Setting up GCC, MinGW, and VS Code for C Development |
Test your understanding of this lesson with 1 questions. Each question has one correct answer.