Header File in C in Hindi – हैडर फाइल क्या है?

Hello दोस्तों! आज हम इस पोस्ट में Header File in C in Hindi (C में हैडर फाइल क्या है?) के बारें में पढेंगे और इसके types को भी देखेंगे. आप इसे पूरा पढ़िए, आपको यह आसानी से समझ में आ जायेगा. तो चलिए शुरू करते हैं:-

Header File in C in Hindi

  • C language में, एक header file एक फाइल होती है जिसका .h extension होता है और यह function declaration और macro definitions को store किये रहता है.

  • दूसरे शब्दों में कहें तो, “Header file एक file होती है जो पहले से define किये हुए standard library functions के समूह को contain (सम्मिलित) किये रहता है.”

  • सभी header files का extension .h होता है.

  • ‘#include’ का प्रयोग header files को program में include करने के लिए किया जाता है.

  • Header files दो प्रकार की होती है. पहली वो जिन्हें programmer खुद लिखता है और दूसरी files कम्पाइलर के साथ आती है.

एक हैडर फाइल में निम्नलिखित चीजें सम्मिलित रहती है:-

  1. Function definitions
  2. Data type definitions
  3. Macros

C language में, प्रत्येक program को <stdio.h> हैडर फाइल का प्रयोग करना जरुरी होता है क्योंकि इसके ही मदद से scanf() फंक्शन input को लेता है और printf() फंक्शन output को display करता है.

Header file का syntax

हम इसके syntax को दो तरीकों से define कर सकते हैं.

1)- #include<filename.h>

इसमें header file का नाम angular brackets (<>) के अंदर लिखा जाता है. यह हैडर फाइल को define करने का सामान्य तरीका है.
इसका example#include<string.h>

2) – #include”filename.h” या #include “filename”

इसका प्रयोग user के द्वारा define की हुई header files के लिए किया जाता है. इसमें हैडर फाइल के नाम को double quote (“ ”) के अंदर रखा जाता है.

Types of Header files in Hindi – हैडर फाइल के प्रकार

इसके दो प्रकार होते हैं. जो कि निम्नलिखित हैं:-

  1. User-defined header files
  2. Standard library header files

User-defined header files –

ये files यूजर के द्वारा define की जाती है और इसे “#include” के द्वारा import किया जा सकता है.

Standard library header files

ये फाइल्स compiler में पहले से मौजूद होती है. इन्हें सिर्फ import करने की आवश्यकता होती है. नीचे आपको compiler में पहले से मौजूद header file की list दी गयी है.

<stdio.h>Standard Input/Output functions
<errno.h>For testing error codes
<conio.h>Console Input/Output functions
<assert.h>Program assertion functions
<ctype.h>Character type functions
<locale.h>Localization functions
<math.h>Mathematics functions
<setjmp.h>Jump functions
<signal.h>Signal handling functions
<stdarg.h>Variable arguments handling functions
<stdlib.h>Standard Utility functions
<string.h>String handling functions
<time.h>Date time functions

इसे पढ़ें:-

खुद की header file कैसे create करते है?

C लैंग्वेज में, हम खुद की header file को create कर सकते हैं और उन्हें अपने program में add कर सकते हैं. यह code की functionality और readability को बढ़ा देता है. नीचे आपको इसको create करने के steps दिए गये हैं:-

1:- सबसे पहले अपने code को लिखे और उसे .h extension के साथ save कर दे.

2:- अपने program में इस header file को “#include” के साथ include कर दे.

Advantage of Header files in Hindi – इसके लाभ

इसके लाभ निम्नलिखित हैं:-

  • प्रत्येक हैडर फाइल किसी एक विशेष operation को perform करता है.
  • इन्हें प्रयोग करना आसान होता है.
  • इससे program को लिखने में कम समय लगता है.
  • यह compile time की speed को बढ़ा देता है.
  • इससे हम code को आसानी से पढ़ सकते है अर्थात यह code की readability को बढ़ा देता है.

Header file का program

नीचे दिए गये program में बहुत सारें standard library header files का प्रयोग किया गया है.

#include <stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>

int main() {
   char s1[20] = "56789";
   char s2[10] = "Yugal";
   char s3[10] = "Joshi";
   int res;

   res = pow(5, 3);
   printf("Using math.h, The value is : %d\n", res);

   long int a = atol(s1);
   printf("Using stdlib.h, the string to long int : %d\n", a);
   
   strcpy(s2, s3);
   printf("Using string.h, the strings s2 and s3 : %s\t%s\n", s2, s3 );

   return 0;
}

इसका आउटपुट –

Using math.h, The value is : 125
Using stdlib.h, the string to long int : 56789
Using string.h, the strings s2 and s3 : Joshi Joshi

references:- https://www.tutorialspoint.com/cprogramming/c_header_files.htm

आप इसकी YouTube video भी देख सकते हैं:-

header file in c in hindi

निवेदन:- मुझे उम्मीद है कि यह post आपके लिए useful रही होगी. इसे अपने friends और classmates के साथ अवश्य share कीजिये. और आपके जो भी C language या किसी अन्य subjects से सम्बन्धित कोई question हो तो उसे नीचे comment करके बताइए. keep learning…

2 thoughts on “Header File in C in Hindi – हैडर फाइल क्या है?”

Leave a Comment