LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-18-2003, 07:39 AM   #1
Gethyn
Member
 
Registered: Aug 2003
Location: UK
Distribution: (X)Ubuntu 10.04/10.10, Debian 5, CentOS 5
Posts: 900

Rep: Reputation: 32
c++ question about nested classes


Can someone please explain to me what the difference is between:
a) declaring a nested class as a friend of the class it's inside
b) declaring the members of the main class as protected, thereby allowing the nested class access to them
?
I've got a vague idea but it'd be nice to hear what more knowledgeable people have to say.
The thought has occurred to me that (b) isn't actually possible as 'protected' applies to inheritance (whereas the use i'm suggesting implies composite rather than inherited classes).

Thanks!

Last edited by Gethyn; 08-18-2003 at 07:54 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Starting a nested X (or something like that :-D) oribd Linux - Newbie 2 10-21-2005 07:33 AM
C++ nested classes enemorales Programming 5 05-23-2005 03:40 PM
OOP (PHP) classes and extended classes ldp Programming 3 03-05-2005 11:45 AM
C++ Classes question gamehack Programming 6 04-24-2004 10:30 AM
C++ classes question Ilswyn Programming 3 09-08-2002 02:19 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration