Hi there,
Welcome to the forums. I'm no expert, but here's how I analyze that line:
"Set pLocalPlayer equal to the given memory address and treat it as a pointer to another cLocalPlayer pointer".
As you know, a pointer is basically a variable which holds a memory address.
cLocalPlayer**
is actually a pointer to a pointer (hence the double asterisk).
Remember that when the asterisk follows the typename, it is a pointer type, when it precedes a variable name, it is dereferencing.
So in your example, you are setting pLocalPlayer's value (a memory address) to the memory address given and you tell the compiler to treat it as a pointer to another cLocalPlayerPointer.
Sorry for the abstract explanation, but that's probably the best I could do without making a drawing.
Maybe this article can help you understand a little better:
http://www.codeproject.com/Articles/4894/Pointer-to-Pointer-and-Reference-to-Pointer
I'm wondering if it is allowed to assign a pointer to a pointer to a regular pointer though - I don't think so.
I think your example should be:
1 2
|
cLocalPlayer **pLocalPlayer; //double asterisk here
pLocalPlayer = (cLocalPlayer**)(some address here eg. 0x045000)
|
Maybe one of the experts around here can chime in.
Hope that helps,
NwN