Posts

Showing posts with the label Compile Time Polymorphism

Operator Overloading in C++ - Introduction, Advantages, Rules and Restrictions

Introduction to Operator Overloading in C++ Operator overloading is an important feature of Object-Oriented Programming (OOP) in C++. It allows programmers to define or customize the meaning of existing operators when they are used with user-defined data types such as classes and objects. C++ में Operator Overloading, Object-Oriented Programming (OOP) का एक महत्वपूर्ण feature है। इसकी सहायता से programmer existing operators के meaning को user-defined data types जैसे classes और objects के लिए define या customize कर सकता है। In C++, operators such as + , - , * , == and ++ normally work with built-in data types like int , float and char . However, operator overloading allows us to use these operators with objects in a meaningful way. C++ में + , - , * , == और ++ जैसे operators सामान्यतः int , float और char जैसे built-in data types के साथ कार्य करते हैं। Operator overloading की मदद से हम इन operators का उपयोग objects के साथ भी meaningful तरीके से कर सकते हैं। Example: Addition of Tw...