Simple question: How come, in DDraw, when I declare this:
LPDIRECTDRAW lpDD;
It makes lpDD a pointer?! What gives? Am I overlooking a special C programming feature (because of my lack of, uh, experience) or is "Windows Weirdness"?
Dare wa neko o koroshiteimasuka? (Ha! Learn Nihongo!)
Windows programming weirdness
No, that''s just the way it''s declared.
You can say this:
typedef struct {
int x, y, z;
} MYSTRUCT, *LPMYSTRUCT;
Then you can declare a structure like this:
MYSTRUCT MyStruct;
And a Pointer to a MYSTRUCT like this:
LPMYSTRUCT lpMyStruct; // same as MYSTRUCT* lpMyStruct;
Hope that helps..
// CHRIS
You can say this:
typedef struct {
int x, y, z;
} MYSTRUCT, *LPMYSTRUCT;
Then you can declare a structure like this:
MYSTRUCT MyStruct;
And a Pointer to a MYSTRUCT like this:
LPMYSTRUCT lpMyStruct; // same as MYSTRUCT* lpMyStruct;
Hope that helps..
// CHRIS
// CHRIS [win32mfc]
Yeah, that helped. I always wondered why you would use typedef''s instead of just declaring a struct. Maybe that''s not the singular reason, but I understand now.
Thanks!
Dare wa neko o koroshiteimasuka? (Ha! Learn Nihongo!)
Thanks!
Dare wa neko o koroshiteimasuka? (Ha! Learn Nihongo!)
"Now watch as I run away in a womanly fashion." - Batman
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement