Static and Dynamic Binding in C++ in Hindi

हेलो स्टूडेंट्स, इस पोस्ट में हम आज Static and Dynamic Binding in C++ in Hindi के बारे में पढ़ेंगे | इंटरनेट में C++ भाषा के नोट्स हिंदी में बहुत कम उपलब्ध है, लेकिन हम आपके लिए यह हिंदी में डिटेल्स नोट्स लाये है, जिससे आपको यह टॉपिक बहुत अच्छे से समझ आ जायेगा |

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

अनुक्रम (contents)

Static and Dynamic Binding in C++ in Hindi

Binding एक प्रक्रिया है जिसमें identifiers को address में convert किया जाता है. Binding प्रत्येक variable और functions के लिए की जाती है. यह प्रक्रिया run time या compile time में होती है.

Static Binding in C++ in Hindi

  • Static binding को early binding या compile-time polymorphism भी कहते हैं.
  • यह बाइंडिंग compile-time में पूरी होती है.
  • इसमें, function call की matching सही function definition के साथ compile time में होती है.
  • static binding को ऑपरेटर ओवरलोडिंग और फंक्शन ओवरलोडिंग का प्रयोग करके प्राप्त किया जाता है.
  • चूँकि यह बाइंडिंग compile time होती है इसलिए इसमें एक program का execution तेज होता है.

Also read : Message Passing in C++ in Hindi

इसका program

#include<iostream>
using namespace std;
class Base {
public:
void display() {
cout<<" In Base class" <<endl;
}
};
class Derived: public Base {
public:
void display() {
cout<<"In Derived class" << endl;
}
};
int main(void) {
Base *base_pointer = new Derived;
base_pointer->display();
return 0;
}

इसका आउटपुट –
In Base Class

Dynamic Binding in C++ in Hindi

  • Dynamic Binding को late binding और runtime polymorphism भी कहते हैं.
  • यह बाइंडिंग runtime में होती है.
  • इसमें, function call की matching सही function definition के साथ runtime में होती है.
  • Dynamic binding को virtual functions का प्रयोग प्राप्त किया जाता है.
  • चूँकि यह runtime में होता है इसलिए इसमें code का execution थोडा slow होता है.
  • डायनामिक बाइंडिंग का मुख्य लाभ यह है कि यह flexible होता है. इसमें केवल एक function अलग-अलग प्रकार के objects को runtime में handle कर सकता है.

इसका program

using namespace std;
class A
{
public:
virtual void display()
{
cout<<"Base";
}
};

class B:public A
{
public:
void display()
{
cout<<"Derived";
}
};
int main()
{
B b;
A *a=&b;
a->display();
return 0;
}

references:- https://www.techiedelight.com/difference-between-static-dynamic-binding-cpp/

static and dynamic in c++ in hindi

निवेदन:- अगर आपके लिए यह article उपयोगी रहा हो तो इसे अपने friends के साथ अवश्य share कीजिये. आपके जो भी questions है उन्हें नीचे comment करके बताइये. अगर आपके दूसरे subjects से related कोई सवाल हो तो उसे भी कमेंट करके बताइए. मैं उसे 1-2 दिन में add कर दूंगा. धन्यवाद.

अपने दोस्तों के साथ share कीजिये.

Related

हम आशा करते है कि यह Static and Dynamic Binding in C++ in Hindi के हिंदी में नोट्स आपकी स्टडी में उपयोगी साबित हुए होंगे | अगर आप लोगो को इससे रिलेटेड कोई भी किसी भी प्रकार का डॉउट हो तो कमेंट बॉक्स में कमेंट करके पूंछ सकते है | आप इन्हे अपने Classmates & Friends के साथ शेयर करे |

Leave a Comment

Your email address will not be published. Required fields are marked *