# *WINAPI

This topic is 3318 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

im curious as to why this function uses *WINAPI in: D3DXVECTOR *WINAPI D3DXVec3Normalize I know WINAPI is a calling convention for some behind the scenes stuff in windows api. like int WINAPI WinMain but why *WINAPI?

##### Share on other sites
That's not a *WINAPI, that's a D3DXVECTOR *.

##### Share on other sites
Which is also why I think the type *something else convention is really stupid and needs to go. Yeah, sure, being able to distinguish such cases comes experience and all that, but it still has an immense and needless ability to confuse the hell out of people. Do your part, declare pointers with an asterisk immediately following the type!

##### Share on other sites
Like this?
Entity* me, you;

##### Share on other sites
Quote:
 Original post by CadetUmferLike this?*** Source Snippet Removed ***

No, that is also wrong, your example also needs an asterisk before the you. I suppose it is all highly subjective, but in my opinion the most readable way of declaring multiple pointers of the same type is as such:

Entity* me;
Entity* you;

Another possibility is:

typedef Entity* EntityPtr;
EntityPtr me, you;

##### Share on other sites
Quote:
Original post by Khaos Dragon
Quote:
 Original post by CadetUmferLike this?*** Source Snippet Removed ***

No, that is also wrong, your example also needs an asterisk before the you.

I think he may have been being sarcastic to show InvalidPointer the reason why the * is often in front of the variable and not the type.
However, i agree with InvalidPointer that it's a stupid idea and i too use the * following the type wherever possible. I tend to think of pointers to variables as a different type (like in Khaos Dragon's example: typedef Entity* EntityPtr), in which case i think CadetUmfer's example should be how it is done

• 23
• 10
• 19
• 16
• 14