Jumat, 10 Maret 2017

How Friend Class Works in C++ Programming

A friend class is a class which can access the private and protected members of another class. If a class B has to be declared as a friend of class A, it is done as follows: 1 2 3 4 5 6 class A { friend class B; ... ... };   Following are properties of a friend class: A class can be friend of any number of classes. When a class A becomes the friend of class B, class A can access all the members of class B. But class B can access only the public members of class

The post How Friend Class Works in C++ Programming appeared first on Coding Security.


How Friend Class Works in C++ Programming
read more

Tidak ada komentar:

Posting Komentar