Re: Problem with defining an opaque structure
Re: Problem with defining an opaque structure
- Subject: Re: Problem with defining an opaque structure
- From: Ondra Cada <email@hidden>
- Date: Mon, 19 Aug 2002 16:35:55 +0200
On Monday, August 19, 2002, at 03:41 , Pierre-Olivier Latour wrote:
I'm trying to define an opaque structure:
struct OpaqueStructure;
typedef struct OpaqueStructure;
typedef OpaqueStructure* OpaqueStructurePtr;
typedef struct {
OpaqueStructurePtr stuff;
} OtherStructure;
...
I don't get what I'm doing wrong since as far as I remember this code
works
with C/C++ compiler.
With C++ it might, with C it should not. Try
typedef struct OpaqueStructure OpaqueStructure;
typedef OpaqueStructure* OpaqueStructurePtr;
(beware, not tested, might overlooked something. The gist is that in C a
structure name without "struct" can't be used as a type, and that your
first and second lines are both meaningless.)
---
Ondra Hada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
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.