Posts

Pointer in C Language (पॉइंटर)

 Introduction to Pointer A pointer is a special type of variable in C language that stores the memory address of another variable. Unlike ordinary variables, which store data values, a pointer stores the address where a particular data value is located in computer memory. C language provides pointers to access and manipulate memory directly. Pointers are widely used in arrays, strings, structures, unions, functions, and dynamic memory allocation. सी लैंग्वेज में पॉइंटर (Pointer) एक विशेष प्रकार का वेरिएबल होता है, जो किसी दूसरे वेरिएबल का मेमोरी एड्रेस संग्रहित करता है। सामान्य वेरिएबल में डाटा की वैल्यू संग्रहित होती है, जबकि पॉइंटर वेरिएबल में उस मेमोरी स्थान का एड्रेस संग्रहित होता है, जहाँ डाटा रखा जाता है। C लैंग्वेज में पॉइंटर का प्रयोग मेमोरी को एक्सेस तथा मैनेज करने के लिए किया जाता है। पॉइंटर का प्रयोग Array, String, Structure, Union, Function तथा Dynamic Memory Allocation आदि में किया जाता है। Definition of Pointer A pointer is a variable that stores the memory address of...

Union (यूनियन) in C Language – Definition, Syntax, Initialization and Examples

Introduction to Union A union is a user-defined data type in C language. It is also known as a heterogeneous or non-homogeneous data type because it can contain members of different data types. Union is used to group different types of data elements under a single name. It is declared using the union keyword. C लैंग्वेज में यूनियन (Union) एक यूजर डिफाइन्ड डाटा टाइप है। इसे हेटेरोजिनस या नॉन-होमोजिनस डाटा टाइप भी कहा जाता है, क्योंकि इसमें विभिन्न डाटा टाइप के मेम्बर्स को एक साथ डिफाइन किया जा सकता है। यूनियन को union कीवर्ड की सहायता से बनाया जाता है। इसका प्रयोग विभिन्न प्रकार के डाटा को एक ही नाम के अंतर्गत संग्रहित करने के लिए किया जाता है। The main difference between a structure and a union is that in a structure, each member has its own memory location, whereas in a union, all members share the same memory area. स्ट्रक्चर तथा यूनियन में मुख्य अंतर यह है कि स्ट्रक्चर में प्रत्येक मेम्बर के लिए अलग-अलग मेमोरी आवंटित होती है, जबकि यूनियन में सभी मेम्बर्स एक ही मेमोरी स्थान को शेयर ...

Structure (स्ट्रक्चर) in C Language – Definition, Syntax, Initialization and Examples

Introduction to Structure A structure is a user-defined data type in C language. It is used to group different types of data elements under a single name. A structure is also known as a heterogeneous or non-homogeneous data type because it can contain members of different data types. स्ट्रक्चर (Structure) C लैंग्वेज का एक यूजर डिफाइन्ड डाटा टाइप है। इसका प्रयोग विभिन्न प्रकार के डाटा एलीमेंट्स को एक ही नाम के अंतर्गत संग्रहित करने के लिए किया जाता है। स्ट्रक्चर को हेटेरोजीनियस या नॉन-होमोजीनियस डाटा टाइप भी कहा जाता है, क्योंकि इसमें विभिन्न डाटा टाइप के मेम्बर्स को एक साथ रखा जा सकता है। For example, if we want to store the information of a student, we may require the following data: Roll Number (Integer) Name (Character Array) Gender (Character) Fees (Float) इन सभी डाटा एलीमेंट्स के डाटा टाइप अलग-अलग हैं। यदि हम इन सभी को अलग-अलग वेरिएबल में संग्रहित करते हैं, तो इन्हें एक साथ मैनेज करना कठिन हो सकता है। Structure provides a convenient way to store all these related data elements tog...

Introduction to C Language (C भाषा का परिचय)

What Is C Language? (C भाषा क्या है?) Introduction to C Language (C भाषा का परिचय) C is a general-purpose, procedural programming language developed by Dennis Ritchie at Bell Laboratories in 1972. It is widely used for system programming, operating systems, embedded systems, and application development. C has also influenced many modern programming languages, including C++, Java, and C#. C एक सामान्य उद्देश्य (General-Purpose) वाली प्रक्रियात्मक (Procedural) प्रोग्रामिंग भाषा है, जिसे डेनिस रिची ने 1972 में Bell Laboratories में विकसित किया था। इसका उपयोग सिस्टम प्रोग्रामिंग, ऑपरेटिंग सिस्टम, एम्बेडेड सिस्टम और सॉफ्टवेयर विकास में किया जाता है। C ने C++, Java और C# जैसी कई आधुनिक प्रोग्रामिंग भाषाओं को प्रभावित किया है। Why Should Students Learn C? (विद्यार्थियों को C क्यों सीखनी चाहिए?) Learning C helps students develop a strong foundation in computer programming. C सीखने से विद्यार्थियों को प्रोग्रामिंग की मूल अवधारणाओं को समझने में मदद मिलती है। Easy to understand: Helps beginners ...

Memory Layout in C Programming सी प्रोग्रामिंग में मेमोरी लेआउट

When a C program runs, memory is divided into different sections called memory segments. जब कोई C program execute होता है तब memory विभिन्न sections में विभाजित होती है जिन्हें memory segments कहा जाता है। Main Memory Segments मुख्य मेमोरी सेग्मेंट्स 1. Text Segment Stores executable program code. यह executable program code store करता है। 2. Data Segment Stores initialized global and static variables. यह initialized global तथा static variables store करता है। 3. BSS Segment Stores uninitialized global and static variables. यह uninitialized global तथा static variables store करता है। 4. Heap Segment Used for dynamic memory allocation using malloc() and calloc(). यह malloc() तथा calloc() द्वारा dynamic memory allocation के लिए उपयोग होता है। 5. Stack Segment Stores local variables and function calls. यह local variables तथा function calls store करता है। Memory Layout Diagram ----------------- | Stack | ----------------- | Heap | ----------------- | BSS Segment | ---------...

Linux Environment for C Programming सी प्रोग्रामिंग के लिए लिनक्स एनवायरनमेंट

Linux is one of the most popular operating systems for C programming and system-level development. Linux C programming तथा system-level development के लिए सबसे लोकप्रिय operating systems में से एक है। Most compilers like GCC are pre-installed or easily available in Linux. Linux में GCC जैसे compilers आसानी से उपलब्ध होते हैं। Important Linux Commands महत्वपूर्ण लिनक्स कमांड्स Compile Program gcc program.c -o program Run Program ./program List Files ls Clear Terminal clear Advantages of Linux for C Programming लिनक्स के लाभ Fast development environment Better terminal support Powerful debugging tools Open-source platform Linux provides a stable, secure, and powerful environment for C programming and software development. Linux C programming तथा software development के लिए stable, secure तथा powerful environment प्रदान करता है।

Static Linking vs Dynamic Linking स्टेटिक लिंकिंग एवं डायनामिक लिंकिंग

Linking is the process of combining object files and libraries to create an executable program. Linking वह प्रक्रिया है जिसमें object files तथा libraries को जोड़कर executable program बनाया जाता है। Static Linking स्टेटिक लिंकिंग In static linking, library code is copied directly into the executable file. स्टेटिक लिंकिंग में library code executable file में सीधे copy हो जाता है। Advantages: Faster execution No external dependency Disadvantages: Large executable size Dynamic Linking डायनामिक लिंकिंग  In dynamic linking, external shared libraries are loaded during runtime. Dynamic linking में external shared libraries runtime के दौरान load होती हैं। Advantages: Smaller executable size Easy library updates Disadvantages: Dependency on external libraries Comparison तुलना Static Linking Dynamic Linking Large executable       Small executable Faster       Slightly slower No dependency      Requires shared libraries Static linking improves porta...