By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,657 Members | 994 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,657 IT Pros & Developers. It's quick & easy.

another boring class question

P: n/a
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
Jul 22 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Dave wrote:

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


No.

Jul 22 '05 #2

P: n/a
Dave wrote:
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?

--
Phlip
Jul 22 '05 #3

P: n/a
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.
Jul 22 '05 #4

P: n/a
Dave wrote:
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.


And what do your other tutorials say?

--
Phlip
Jul 22 '05 #5

P: n/a

"Dave" <da**********************************@hotmail.co m> wrote in message
news:3f******@dnews.tpgi.com.au...
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.


Right. Are you confused about what "friends" are?
Jul 22 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.