Re: Problem with defining an opaque structure
Re: Problem with defining an opaque structure
- Subject: Re: Problem with defining an opaque structure
- From: "Ken Thomases" <email@hidden>
- Date: Mon, 19 Aug 2002 18:26:37 -0500
- Priority: normal
On 19 Aug 2002, at 9:18, Pierre-Olivier Latour wrote:
>
Hi,
>
>
I'm trying to define an opaque structure:
>
>
struct OpaqueStructure;
This line forward-declares the struct. It's fine.
>
typedef struct OpaqueStructure;
This is your problem I think. I think you wanted:
typedef struct OpaqueStructure OpaqueStructure;
I don't see how your original line would be valid C. You failed to
provide a name for the new type you were trying to define.
>
typedef OpaqueStructure* OpaqueStructurePtr;
>
>
typedef struct {
>
OpaqueStructurePtr stuff;
>
} OtherStructure;
This all looks good to me.
Hope that helps,
Ken
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.