Re: [Dev-C++] Struct "tags" and things
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ioannis V. <no...@ho...> - 2003-02-27 13:56:39
|
-------Original Message-------=0D
=0D
From: Daniel Glenfield=0D
Date: =D0=DD=EC=F0=F4=E7, 27 =D6=E5=E2=F1=EF=F5=DC=F1=E9=EF=F2 2003 2:08:=
53 =EC=EC=0D
To: dev...@li...=0D
Subject: [Dev-C++] Struct "tags" and things=0D
=0D
=0D
typedef struct _MyStruct=0D
{=0D
//...Data=0D
=0D
} MyStruct, FAR * LPMYSTRUCT=0D
=0D
=0D
My questions are=0D
1) Why is it _MyStruct at the top? Is that the structure's real name and =
=0D
MyStruct is the typedef'd name?=0D
=0D
=0D
=3D=3D> _MyStruct is the name of the type and MyStruct is a synonym. It i=
s
equivalent of:=0D
=0D
struct _MyStruct=0D
{=0D
// ...=0D
}FAR * LPMYSTRUCT;=0D
=0D
typedef _MyStruct MyStruct;=0D
=0D
=0D
=0D
=0D
=0D
2) I know about FAR pointers, but why is a pointer needed here? Why don't=
I =0D
just put MyStruct* LPMYSTRUCT; in my code?=0D
=0D
=0D
=3D=3D> FAR is a system dependent keyword. The above is equivalent to:=0D
=0D
MyStruct FAR *LPMYSTRUCT;=0D
=0D
=0D
=0D
=0D
Ioannis Vranos=0D
=0D
* Programming pages: http://www.noicys.freeurl.com=0D
* Alternative URL: http://run.to/noicys=20 |