dos.h header file important functions in C language in Hindi | delay(),sleep(),getdate(),gettime(),sound(),nosound()

 हेलो दोस्तों !

आज की इस dos.h header file important functions in C language in Hindi पोस्ट में हम dos.h header file के कुछ important functions के बारे में जानेंगे। तो दोस्तों अगर आप dos.h header file के इन इम्पोर्टेन्ट फंक्शन्स को अच्छी तरह समझना चाहते है तो इस पोस्ट को अंत तक जरूर पढ़े। 

इस पोस्ट के मुख्य टॉपिक्स निन्म है :-

  1. dos.h header file क्या है ?
  2. dos.h header file के important functions .

1. dos.h header file क्या है :-

तो दोस्तों सबसे पहले हम dos.h header file के बारे में जान लेते है। 


dos.h header file functions in c language in hindi



दोस्तों dos.h हैडर फाइल C लैंग्वेज की एक हैडर फाइल है। dos.h हैडर फाइल के अंदर सिस्टम से रिलेटेड फंक्शन डिक्लेअर किये गए है। जैसे delay(),sleep(),getdate(),dettime(),sound(),nosound() functions है। dos.h हैडर फाइल बोरलैंड आधारित हैडर फाइल है। यह हैडर फाइल टर्बो C कम्पाइलर पर वर्क करती है। इस हैडर फाइल का ज्यादातर यूज़ टर्बो C/C++ IDE पर किया जाता है। 

2. dos.h header file के important functions :-

तो दोस्तों अब हम dos.h header file के important फंक्शन्स को जान लेते है। 

दोस्तों ये है इस हैडर फाइल के कुछ महत्वपूर्ण फंक्शन्स -
  1. dealy() function
  2. sleep() function
  3. getdate() function
  4. gettime() function
  5. sound() function
  6. nosound() function

दोस्तों अब हम इन फंक्शन्स को थोड़ा विस्तार से जान लेते है की इन फंक्शन्स का यूज़ क्यों किया जाता है। 

1.delay() function :-

delay फंक्शन का यूज़ प्रोग्राम के execution को कुछ समय रोकने के लिए किया जाता है। delay फंक्शन को कॉल करते समय हम इस फंक्शन को पैरामीटर्स के रूप में वह वैल्यू पास करते है जितने मिली सेकंड के लिए हमें प्रोग्राम के execution को रोकना है। इसका यूज़ प्रोग्राम को कुछ मिली सेकंड के लिए रोकने में किया जाता है। 

Syntax :-  delay(unsigned int);

Example program of delay function :-

#include< stdio.h >
#include< dos.h >
void main()
{
  printf("Hello!");
  delay(5000);
  printf("I am AKSHAY\n");
  sleep(3);
}

2.sleep() function :-

दोस्तों sleep फंक्शन भी delay फंक्शन की ही तरह प्रोग्राम के execution को कुछ निश्चित समय के लिए रोकने के लिए किया जाता है। लेकिन स्लीप फंक्शन को हम जो वैल्यू पास करते है वह उसे सेकण्ड्स के लिए प्रोग्राम का execution रोक देता है। जबकि delay फंक्शन millisecond वैल्यू को accept करता है। जब भी हमें कुछ सेकण्ड्स के लिए प्रोग्राम के execution को स्टॉप करना है तो हम इस फंक्शन का यूज़ करते है। 

Syntax :-  sleep(unsigned second);

Example program of sleep function :-

#include< stdio.h >
#include< dos.h >
void main()
{
  printf("Hello!");
  delay(5000);
  printf("I am AKSHAY\n");
  sleep(3);
}

3.getdate() function :-

दोस्तों getdate फंक्शन के नाम से ही पता चलता है की यह फंक्शन क्या काम करता है। यह फंक्शन सिस्टम की करंट डेट को return करता है। जब भी हमें सिस्टम की डेट की जरुरत होती है तो हम getdate फंक्शन को काल करते है और यह फंक्शन हमें सिस्टम की डेट को return करता है। 

Syntax :-  getdate( struct date dt );

Example program of getdate function :-

#include< stdio.h >
#include< conio.h >
#include< time.h >
#include< dos.h >
void main()
{
  struct date dt;
  struct time t;
  clrscr();
  getdate(&dt);
  printf("This is current date : %d-%d-%d\n",dt.da_day,dt.da_mon,dt.da_year);
  gettime(&t);
  printf("This is current time : %d:%d:%d:%d\n",t.ti_hour,t.ti_min,t.ti_sec,t.ti_hund);
  getch();
}

4.gettime() function :-

दोस्तों जैसे getdate फंक्शन सिस्टम की करंट डेट को return करता है। उसी प्रकार gettime फंक्शन भी सिस्टम की करंट डेट को return करता है।  जिस सिस्टम पर उस प्रोग्राम को execute किया जा रहा है। इसका मतलब है की अगर हमें सिस्टम के current टाइम की जरुरत है तो हम gettime फंक्शन की मदद से पता कर सकते है। 

Syntax :-  gettime( struct time t);

Example program of gettime function :-

#include< stdio.h >
#include< conio.h >
#include< time.h >
#include< dos.h >
void main()
{
  struct date dt;
  struct time t;
  clrscr();
  getdate(&dt);
  printf("This is current date : %d-%d-%d\n",dt.da_day,dt.da_mon,dt.da_year);
  gettime(&t);
  printf("This is current time : %d:%d:%d:%d\n",t.ti_hour,t.ti_min,t.ti_sec,t.ti_hund);
  getch();
}

5.sound() function :-

दोस्तों sound फंक्शन के नाम से ही पता चलता है की यह फंक्शन साउंड को produce करने के लिए यूज़ किया जाता है। यह फंक्शन एक आर्गुमेंट लेता है जोकि साउंड की frequency होती है। मतलब इस फंक्शन को कॉल करते समय हमें साउंड की frequency पास करनी पड़ती है की हमें कितनी फ्रीक्वेंसी का साउंड produce करना है। तो जब भी हमें साउंड produce करने की जरुरत पड़ती है तो हम इस फंक्शन का यूज़ करते है। 

Syntax :-  sound(int frequency);

Example program of sound function :-

#include< conio.h >
#include< dos.h >
void main()
{
int i;
for(i=0;i < 1000; i=i+40)
{
sound(i);
delay(25);
}
nosound();
getch();
}

6.nosound() function :-

दोस्तों nosound फंक्शन एक important फंक्शन होता है। यह साउंड को क्लोज करने के लिए यूज़ किया जाता है। जब भी हम साउंड फंक्शन का यूज़ साउंड produce करने के लिए करते है। तो हमें उस उस साउंड को क्लोज करने के लिए nosound फंक्शन का यूज़ करना पड़ता है। अगर हम ऐसा नहीं करते है तो साउंड प्रोग्राम का execution ख़त्म होने के बाद भी चलता रहता है। इसलिए हमें sound फंक्शन का यूज़ करने के बाद nosound फंक्शन का यूज़ करना पड़ता है। 

Syntax :-  nosound(void);

Example program of nosound function :-

#include< conio.h >
#include< dos.h >
void main()
{
int i;
for(i=0;i < 1000; i=i+40)
{
sound(i);
delay(25);
}
nosound();
getch();
}

इन पोस्ट को भी पढ़े :-


Author :- तो दोस्तों अब हमारी यह dos.h header file important functions in C language in Hindiपोस्ट ख़त्म होती है हम आशा करते है की आपको हमारी यह पोस्ट जरूर पसंद आई होगी और आप dos.h header file के important functions को अच्छी तरह समझ गए होंगे। तो दोस्तों आज के लिए बस इतना ही फिर मिलेंगे ऐसी ही किसी और इंटरेस्टिंग पोस्ट में तब तक के लिए अलविदा !

Post a Comment

0 Comments