Posts

Showing posts with the label object file in C

Object Files in C Programming सी प्रोग्रामिंग में ऑब्जेक्ट फाइल्स

An Object File is an intermediate file generated after compilation of a C program. It contains machine-level code but is not directly executable. एक ऑब्जेक्ट फाइल एक intermediate file होती है जो C program के compilation के बाद बनती है। इसमें machine-level code होता है लेकिन यह सीधे execute नहीं होती। Object files usually have extensions: ऑब्जेक्ट फाइल्स की सामान्य extensions होती हैं: .o in Linux .obj in Windows Compilation Process Source Code → Compiler → Object File → Linker → Executable File GCC Command to Generate Object File ऑब्जेक्ट फाइल बनाने की GCC Command gcc -c program.c This command creates: program.o Advantages लाभ Faster compilation Modular programming Reusable code Object files help convert source code into executable programs efficiently using the linking process. ऑब्जेक्ट फाइल linking process की सहायता से source code को executable program में बदलने में सहायता करती हैं।

C Compilation Process Explained (Preprocessor, Compiler, Assembler, Linker)

When we write a C program, the computer cannot directly understand our source code. The program must go through a series of steps before it becomes an executable file. This entire procedure is called the Compilation Process . Most modern C programs are compiled using compilers like GCC and Clang. Understanding this process is essential for advanced programming, debugging, linking multiple files, and system-level development. जब हम C प्रोग्राम लिखते हैं, तो कंप्यूटर सीधे हमारे source code को नहीं समझता। उसे executable फ़ाइल में बदलने के लिए कई चरणों से गुजरना पड़ता है। इस पूरी प्रक्रिया को Compilation Process कहा जाता है। अधिकतर C प्रोग्राम को compile करने के लिए GCC और Clang जैसे compilers का उपयोग किया जाता है। इस प्रक्रिया को समझना advanced programming और debugging के लिए बहुत आवश्यक है। Overview of Compilation Stages Source Code (.c) ↓ Preprocessor ↓ Compiler ↓ Assembler ↓ Object File (.o) ↓ Linker ↓ Executable File 1️⃣ Preprocessing Stage The pr...