473,322 Members | 1,562 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

private structure

Hi all,
I have a question here:
Following is the code:

class x {
private:
typedef int myint;

struct mystr {
myint stInt; <<<<< The Compiler said here that: x:: myint can
not be accessable from x::mystr , whyy???
}

struct mystr2{
x::mystr strInstant; <<<<< The Compiler said here that: x::mystr
can not be accessable from x::mystr2 ????

}
}

could any one help.
BTW: I use Compiler:
Sun WorkShop 6 update 2 C 5.3 Patch 111679-08 2002/05/09

Thanks in advance,

Ahmed Ossman
Jul 19 '05 #1
1 3793

"Ahmed Ossman" <ah**********@mentor.com> wrote in message news:3f******@solnews.wv.mentorg.com...
Hi all,
I have a question here:
Following is the code:

class x {
private:
typedef int myint;

struct mystr {
myint stInt; <<<<< The Compiler said here that: x:: myint can
not be accessable from x::mystr , whyy???
}

You're missing semicolons.

Defining a structure inside a class just defines the type name in that context.
It doesn't convey any special access to the enclosing class.

11.8 is pretty clear:

The members of a nested class have no special access to members of the enclosing
class.

An example that follows shows the same thing you are trying to do as an error.

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Tom | last post by:
Let's say I've got a class defined in a header file. class foo { private: ... int bar; .... }; Now lets say I have a function that needs to access the private variable
3
by: Richard Webb | last post by:
Hi all, I guess this is more of a design problem than a language problem, but I'm confused either way! I have a class and it has a private data member which is a struct. The size of the struct is...
2
by: tolisss | last post by:
Hi could someone explain to me why the followind code fails using System; using System.Collections; using System.Reflection; using MbUnit.Core.Framework; using MbUnit.Framework; namespace...
3
by: Gene Hubert | last post by:
I'm using DataTable.ImportRow to move data from one datatable to another... Dim dt, dtTarget As DataTable Dim dr As DataRow dt = DirectCast(Me.DataSource, DataTable) dtTarget = dt.Clone...
11
by: prefersgolfing | last post by:
I'm trying to find on MSDN, or someplace, that speaks to variables being public or private by default. Anyone know where? Thanks.
12
by: tobias.sturn | last post by:
Hi! My prof told me always to make my members private or protected cause its standard to write setter and getter methodes.. Is that in your opinion correct? Cause I dont see any adventages to...
7
by: Dick | last post by:
I have some simple (private) types... Friend Enum Types Value1 Value2 End Enum Friend Structure Detail Dim Type As Types End Structure
3
by: Mr Flibble | last post by:
I have this in some sample code private short? units; What does the '?' mean? I've only seen '?' as an operator.
23
by: Ben Voigt | last post by:
I have a POD type with a private destructor. There are a whole hierarchy of derived POD types, all meant to be freed using a public member function Destroy in the base class. I get warning C4624....
7
by: shantibhushan.sale | last post by:
Hi, Do we have private(not necessary using private keyword) structure in C?
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.