adspace


What are the various access specifiers in c++?

Answer Posted / Seema Pal

In C++, there are three access specifiers: private (denoted by 'private:' or just 'private'), protected (denoted by 'protected' or 'protected:'), and public (denoted by 'public').nn1) Private: Variables and functions marked as private can only be accessed within the class.n2) Protected: Variables and functions marked as protected can be accessed by the member functions of the class, its derived classes, and friend classes.n3) Public: Variables and functions marked as public can be accessed from anywhere in the program.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What character terminates all character array strings a) b) . c) END

1403


Can union be self referenced?

1275


daily Routine of father

1489


How c functions prevents rework and therefore saves the programers time as wel as length of the code ?

1172


What is the latest version on c++?

1217