Back-End Programming Exam  >  Back-End Programming Videos  >  Learn to Program with C++: Beginner to Expert (in Hindi)  >  158. Example of Pure Virtual Function in C++ (Hindi)

158. Example of Pure Virtual Function in C++ (Hindi) Video Lecture | Learn to Program with C++: Beginner to Expert (in Hindi) - Back-End Programming

186 videos

FAQs on 158. Example of Pure Virtual Function in C++ (Hindi) Video Lecture - Learn to Program with C++: Beginner to Expert (in Hindi) - Back-End Programming

1. प्योर वर्चुअल फंक्शन का साम्प्ल क्या है?
उत्तर: प्योर वर्चुअल फंक्शन एक ऐसा फंक्शन होता है जिसे वर्चुअल बेस क्लास में घोषित किया जाता है और जिसे उपयोगकर्ता द्वारा पुनः लिखा जाना होता है। इसे वर्चुअल फंक्शन के रूप में घोषित किया जाता है ताकि इसे वर्चुअल बेस क्लास के उप-क्लास के द्वारा अद्यतित किया जा सके।
2. प्योर वर्चुअल फंक्शन क्यों उपयोगी होता है?
उत्तर: प्योर वर्चुअल फंक्शन उप-क्लास के लिए एक अवश्यकता बनता है क्योंकि इससे उप-क्लास अपनी अपनी वर्चुअल फंक्शन को अद्यतित कर सकती है और उप-क्लास के वर्चुअल फंक्शन का इम्प्लीमेंटेशन कर सकती है। यह ओवरराइड की जा सकती है और अधिक व्यापक और सुविधाजनक कोड को संभव बनाता है।
3. प्योर वर्चुअल फंक्शन कैसे घोषित किया जाता है?
उत्तर: प्योर वर्चुअल फंक्शन को घोषित करने के लिए आपको उप-क्लास में उसे "virtual" शब्द के साथ घोषित करना होता है। उप-क्लास में यह फंक्शन केवल एक डिफ़ॉल्ट इम्प्लीमेंटेशन होता है जिसे उप-क्लास के द्वारा ओवरराइड किया जा सकता है।
4. C में प्योर वर्चुअल फंक्शन का उपयोग कैसे किया जाता है?
उत्तर: C में प्योर वर्चुअल फंक्शन का उपयोग करने के लिए आपको वर्चुअल बेस क्लास को बनाना होगा और उसके बाद उप-क्लास में प्योर वर्चुअल फंक्शन को घोषित करना होगा। उप-क्लास को इस वर्चुअल फंक्शन को ओवरराइड करने के लिए अपनी अपनी इम्प्लीमेंटेशन प्रदान करनी होगी।
5. C में प्योर वर्चुअल फंक्शन का उपयोग क्यों किया जाता है?
उत्तर: C में प्योर वर्चुअल फंक्शन का उपयोग उप-क्लास के वर्चुअल फंक्शन को ओवरराइड करने के लिए किया जाता है। इससे उप-क्लास अपनी अपनी वर्चुअल फंक्शन को अद्यतित कर सकती है और उप-क्लास के वर्चुअल फंक्शन का इम्प्लीमेंटेशन कर सकती है। यह ओवरराइड की जा सकती है और अधिक व्यापक और सुविधाजनक कोड को संभव बनाता है।
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

Viva Questions

,

pdf

,

mock tests for examination

,

video lectures

,

Summary

,

158. Example of Pure Virtual Function in C++ (Hindi) Video Lecture | Learn to Program with C++: Beginner to Expert (in Hindi) - Back-End Programming

,

Sample Paper

,

Free

,

study material

,

practice quizzes

,

Semester Notes

,

Objective type Questions

,

MCQs

,

shortcuts and tricks

,

Important questions

,

past year papers

,

Previous Year Questions with Solutions

,

Exam

,

ppt

,

158. Example of Pure Virtual Function in C++ (Hindi) Video Lecture | Learn to Program with C++: Beginner to Expert (in Hindi) - Back-End Programming

,

158. Example of Pure Virtual Function in C++ (Hindi) Video Lecture | Learn to Program with C++: Beginner to Expert (in Hindi) - Back-End Programming

,

Extra Questions

;