there is something i want to ask about this

LPDIRECT3D9 pdirectX9;

I understand this is a pointer but why do we not use the * like this

LPDIRECT3D9 *pdirectX9;

when i look over my code it confuses me with a struct

EDIT: doing some reading into this, is it because a typedef structure? like


just renaming this reference? why not just call it direct like



It indeed depends on how the LPDIRECT3D9 is defined, normally you will find a structure definition like:

struct _MYSTRUCT 
[indent]int myInt;
string myString;
} myStruct, *pmyStruct;

And then (I think just as a matter of preference) you can define something like LPMYSTRUCT as a pointer to the myStruct.
I use this a lot because I like it more than having *, for example:

typdef unsigned long DWORD, *PDWORD;

will define DWORD as unsigned long and PDWORD as unsigned long pointer. Saves me typing and it's personally more clear to me where I'm using pointers.

commented: Good point. +10