In C++, an overloaded unary operator defined as a member function requires how many variables to be passed as function argument ?
C++ में, सदस्य फलन के रूप में परिभाषित एक ओवरलोडेड युनरी ऑपरेटर को फंक्शन आर्ग्युमेंट के तौर पर कितने चर पास किये जाने की आवश्यकता होगी ?
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: A. Zeroशून्य
Explanation
A unary operator overloaded as a member function takes no argument — the operand is the calling object (this). As a friend function it would take one.
सदस्य फलन के रूप में ओवरलोड किया गया युनरी ऑपरेटर कोई आर्ग्युमेंट नहीं लेता; ऑपरेंड स्वयं ऑब्जेक्ट (this) होता है। फ्रेंड फलन में एक आर्ग्युमेंट लगता है।
More Programming Concepts & Python questions
- How many times 'save trees' will be displayed by C++ loop ? do { cout << "save trees"; } while(0);
- Consider Column-I and Column-II in context of C++ : Column-I Column-II i. Private a. Data type modifier ii. Sizeof b. Visibility specifier…
- Choose true statements about virtual functions in C++ : I : The virtual functions must be member of some class. II : They cannot be static…
- In context of C++, which of the following is a valid statement ?
- In C file handling equivalent to scanf("%d",&val); is :
- A variable declared within the block {} has the following scope :