Question
Download Solution PDFC++ में ऑपरेटर ओवरलोडिंग क्या है?
Answer (Detailed Solution Below)
Detailed Solution
Download Solution PDFसही उत्तर (1) और (2) दोनों है।
Key PointsC++ में ऑपरेटर ओवरलोडिंग ऑपरेटरों को उपयोगकर्ता-परिभाषित प्रकारों (वर्गों) पर उपयोगकर्ता-परिभाषित अर्थ रखने की अनुमति देता है। इसका अर्थ यह है:
- C++ ऑपरेटरों को ऑब्जेक्ट के साथ काम कराना: आप अपनी कक्षाओं या ऑब्जेक्ट के लिए ऑपरेटर के व्यवहार को परिभाषित कर सकते हैं। उदाहरण - आप भिन्न योग करने के लिए 'Fraction' वर्ग के लिए '+' ऑपरेटर को परिभाषित कर सकते हैं।
- मौजूदा C++ ऑपरेटरों को नया अर्थ देना: अपनी कक्षाओं के लिए ऑपरेटर के व्यवहार को परिभाषित करके, आप अनिवार्य रूप से अपनी कक्षा के संदर्भ के लिए मौजूदा ऑपरेटरों को नया अर्थ दे रहे होते हैं।
विकल्प (3) गलत है क्योंकि, C++ नए ऑपरेटरों के निर्माण की अनुमति नहीं देता है, केवल मौजूदा ऑपरेटरों के लिए नई परिभाषाएँ देता है।
Last updated on Feb 15, 2025
-> The medical verification for Rajasthan Informatics Assistant Recruitment will be held on 17th February to 7th March 2025.
-> Rajasthan Informatics Assistant Notification was released for 3415 vacancies.
-> Candidates can check the Rajasthan Informatics Assistant Previous Year papers which helps in cracking the examination.
-> The applicants can also attempt the RSMSSB Informatics Assistant Test Series.