Accessors

Hi,

Still very new to C++. I am looking at the code below. If the accessor getName() is specified before private is it automatically public?

Thanks
1
2
3
4
5
6
7
8
9
10
11
class Employee
{
Employee ();
string getName();
private:
bool citizen();
24
string lastName;
string firstName;
string employeeNumber;
};
closed account (zb0S216C)
Rascal wrote:
"If the accessor getName() is specified before private is it automatically public?"

No. The default level-of-access inside a "class" is private. In a "struct", the default level-of-access is public.

Wazzak
Thanks so much for the explanation and coming back to me so quickly. Appreciate your assistance.
Topic archived. No new replies allowed.