another boring class question

P

Phlip

Dave said:
class foo {
func(int x);
}

class faa {
foo fooObject;
}

That code is ill-formed; meaning it won't compile.
would the function func(int x) be allowed to access private, public and
protected member variables of faa?

What does your tutorial tell you, thru the index, about those keywords?
 
D

Dave

class foo {
func(int x);
}

class faa {
foo fooObject;
}

would the function func(int x) be allowed to access private, public and
protected member variables of faa?

cheers
dave
 
D

Dave

What does your tutorial tell you, thru the index, about those keywords?
It tells me "friends" can access them, inherited can access public and
protected, but this is neither of those.
 
J

jeffc

Dave said:
It tells me "friends" can access them, inherited can access public and
protected, but this is neither of those.

Right. Are you confused about what "friends" are?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top