Jump to content
  • Advertisement
Sign in to follow this  
rgibson11

*WINAPI

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
Share on other sites
Quote:
Original post by CadetUmfer
Like 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 this post


Link to post
Share on other sites
Quote:
Original post by Khaos Dragon
Quote:
Original post by CadetUmfer
Like 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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!