C++ Quiz-Asked in Interviews.

Placewit
Feb 14, 2022

--

In C++, programs, where does the keyword friend appears?

A) Class allowing access to another class

B) Private section of a class

C) Private section of a class

D) All of these

Solution: D is correct

A friend function in C++ is defined as a function that can access private, protected and public members of a class. The friend function is declared using the friend keyword inside the body of the class.

Thanks for Reading

Placewit grows the best engineers by providing an interactive classroom experience and by helping them develop their skills and get placed in amazing companies.

Learn more at Placewit. Follow us on Instagram and Facebook for daily learning.

--

--

Placewit
Placewit

Written by Placewit

Upskilling students for tech placements!

No responses yet