Back-End Programming Exam  >  Back-End Programming Videos  >  Learn to Program with C++: Beginner to Expert (in Hindi)  >  75. Member function of one class can be friend functions of another class in C++ (Hindi)

75. Member function of one class can be friend functions of another class in C++ (Hindi) Video Lecture | Learn to Program with C++: Beginner to Expert (in Hindi) - Back-End Programming

186 videos

FAQs on 75. Member function of one class can be friend functions of another class in C++ (Hindi) Video Lecture - Learn to Program with C++: Beginner to Expert (in Hindi) - Back-End Programming

1. क्लास के एक सदस्य फंक्शन को क्या दूसरे क्लास के friend फंक्शन बनाया जा सकता है?
Ans. हां, क्लास के एक सदस्य फंक्शन को दूसरे क्लास के friend फंक्शन बनाया जा सकता है। इसके लिए वह सदस्य फंक्शन friend डिक्लेयरेशन के साथ दूसरे क्लास में घोषित किया जाता है। इससे दूसरे क्लास के ऑब्जेक्ट्स को पहुंच मिलती है और वे इस सदस्य फंक्शन को इस्तेमाल कर सकते हैं।
2. क्या एक क्लास के सभी सदस्य फंक्शन friend फंक्शन बना सकते हैं?
Ans. नहीं, एक क्लास के सभी सदस्य फंक्शन friend फंक्शन नहीं बना सकते हैं। केवल वे सदस्य फंक्शन friend बना सकते हैं जो दूसरे क्लास के ऑब्जेक्ट्स को इस्तेमाल करने की अनुमति देते हैं।
3. friend फंक्शन के उपयोग से क्या लाभ हो सकता है?
Ans. friend फंक्शन के उपयोग से क्लास के एक सदस्य फंक्शन को दूसरे क्लास के ऑब्जेक्ट्स को पहुंच देने का लाभ होता है। इससे दूसरे क्लास के ऑब्जेक्ट्स सदस्य फंक्शन को इस्तेमाल कर सकते हैं और उनके आंतरिक डेटा तक पहुंच सकते हैं।
4. friend फंक्शन की डिफाइनेशन कैसे की जाती है?
Ans. friend फंक्शन की डिफाइनेशन दूसरे क्लास में की जाती है। डिफाइनेशन के लिए फंक्शन के पहले friend डिक्लेयरेशन की आवश्यकता होती है जो उसे friend बनाने वाले क्लास में की जाती है। इससे उस फंक्शन को उस क्लास के ऑब्जेक्ट्स की डेटा और सदस्य फंक्शन तक पहुंच मिलती है।
5. friend फंक्शन को कैसे एक्सेस किया जा सकता है?
Ans. friend फंक्शन को उस क्लास के ऑब्जेक्ट के माध्यम से एक्सेस किया जा सकता है जिसका friend बनाने के लिए वह फंक्शन है। इसके लिए ऑब्जेक्ट के नाम के साथ डॉट ऑपरेटर का उपयोग किया जाता है, उसके बाद friend फंक्शन का नाम आता है और उसके बाद कोई भी आवश्यक पैरामीटर पास किए जाते हैं। यह उदाहरण के रूप में दिखाया जा सकता है: obj.friendFunction(parameters);
186 videos
Explore Courses for Back-End Programming exam
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

Previous Year Questions with Solutions

,

mock tests for examination

,

practice quizzes

,

Semester Notes

,

75. Member function of one class can be friend functions of another class in C++ (Hindi) Video Lecture | Learn to Program with C++: Beginner to Expert (in Hindi) - Back-End Programming

,

75. Member function of one class can be friend functions of another class in C++ (Hindi) Video Lecture | Learn to Program with C++: Beginner to Expert (in Hindi) - Back-End Programming

,

shortcuts and tricks

,

Exam

,

study material

,

pdf

,

Free

,

Extra Questions

,

75. Member function of one class can be friend functions of another class in C++ (Hindi) Video Lecture | Learn to Program with C++: Beginner to Expert (in Hindi) - Back-End Programming

,

ppt

,

Objective type Questions

,

video lectures

,

Viva Questions

,

Important questions

,

past year papers

,

Sample Paper

,

MCQs

,

Summary

;