Say I have a struct like the following ...
typedef struct {
int WheelCount;
double MaxSpeed;
} Vehicle;
... and I have a global variabl
The first one should be faster since it doesn't require pointer dereferencing. Then again thats true for x86 based systems, not sure for others.
on x86 the first one would translate to something like this
mov eax, [address of MyGlobal.MaxSpeed]
and the second one would be something like this
mov ebx, [address of pMyGlobal]
mov eax, [ebx+sizeof(int)]