Interviewer And Interviewee Guide

C++ Friend Interview Question:

List the advantages of using friend classes?

Submitted by: Administrator
There are situations when private data members need to be accessed and used by 2 classes simultaneously. In these kind of situations we can introduce friend functions which have an access to the private data members of both the classes. Friend functions need to be declared as 'friend' in both the classes. They need not be members of either of these classes.
Submitted by:

Read Online C++ Friend Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.