The first name directly after struct is an old and strange C thingie,
where the structs lives in their own name-space.
You don't need to declare a pointer type for each data type you create.
It's just that for some environments, the FAR #declare are really needed
and contains __far, far, _far or any number of compiler-specific keyword.
By having declared a pointer type containing that extra FAR thingie, you
don't have to remember to use it everywhere in your program whenever you
need a pointer.
For the majority of the code you write, just do what you like.
/Per W
On Thu, 27 Feb 2003, Daniel Glenfield wrote:
>
>
> typedef struct _MyStruct
> {
> //...Data
>
> } MyStruct, FAR * LPMYSTRUCT
>
>
> My questions are
> 1) Why is it _MyStruct at the top? Is that the structure's real name and
> MyStruct is the typedef'd name?
>
> 2) I know about FAR pointers, but why is a pointer needed here? Why don't I
> just put MyStruct* LPMYSTRUCT; in my code?
>
>
> Following from this, I see
> #define GetMyStructProperties(lpdm) ((LPMYSTRUCT)(lpdm))
>
>
> and the function is called often. What is going on?
>
>
> _________________________________________________________________
> Stay in touch with MSN Messenger http://messenger.msn.co.uk
>
>
>
> -------------------------------------------------------
> This SF.NET email is sponsored by:
> SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
> http://www.vasoftware.com
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|