This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: gcc question about the embedded type definitions
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: Wei ZHANG <wei dot zhang-amk at st dot com>
- Cc: GCC Help <gcc-help at gcc dot gnu dot org>
- Date: Fri, 03 Dec 2004 09:20:09 +0000
- Subject: Re: gcc question about the embedded type definitions
- Organization: Codesourcery LLC
- References: <41B00D06.1050309@st.com>
Wei ZHANG wrote:
Hi,
I have a question on embedded type definitions.
If in a structure definition, another type is defined. e.g.
typedef struct S1 {
struct S2 {
int a;
}
} S1;
is the data type S2 visible outside S1? Originally i think it is not
visible outside.
in C it is visible, in C++ it is not.
in C it declares a field of the outer struct, in C++ it declares
a nested member.
Your example is neither C not C++ though, as it is missing at least a
semi colon.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk