Advertisement

pointers

Started by September 17, 2000 11:13 AM
1 comment, last by SKSlayer 24 years, 2 months ago
Just wondering, doesn''t
    
HWND &ihwnd
HWND *hwnd
... little bit of code
*hwnd=ihwnd;
[/source]
and
[source]
HWND &ihwnd
HWND *hwnd
... little bit of code
hwnd=&ihwnd
    
mean the same thing ??? I guess it doesn''t, cuz it gives me weird result, but, WHY are they differen ?
(you can find me on IRC : #opengl on undernet)
If I remember correctly...

declaring both of these
HWND &ihwnd
HWND *hwnd;

gives a problem when using
*hwnd = ihwnd;
and
hwnd = &ihwnd

This is because you declared ihwnd as the address of a window handle. You should only declare pointers and the things they point to as...

HWND ihwnd;
HWND *hwnd;

hwnd = &ihwnd

You see, if you declare them as you have in your post, you are saying this:

**hwnd = &ihwnd

and

*hwnd = &&ihwnd

Which is not what you want.

S.
Advertisement
oh, I see now, thanks a lot
(you can find me on IRC : #opengl on undernet)

This topic is closed to new replies.

Advertisement