PDA

Click to See Complete Forum and Search --> : Why the &


CyberCarsten
Feb 28th, 2001, 02:15 PM
Take a look at this piece:

TranslateMessage(&msg);


Why is there an ampersand(&) in front of msg????

parksie
Feb 28th, 2001, 02:28 PM
& is like AddressOf in VB.

Translate message takes a pointer to MSG, so it needs the memory location, a bit like ByRef, because it needs to alter it. So, you pass a pointer by getting it's address using &.

CyberCarsten
Feb 28th, 2001, 03:25 PM
Thanks! :)