Does it matter where in a class a friend clause is placed (i.e. within the protected block as opposed to the private block)?
Does it matter where in a class a friend clause is placed (i.e. within
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No it does not.
All three classes are now friends of
Xand share the exact same priviliges.A good convention is to group all friend declarations together for visibility, but that’s just style.
11.4 Friends