Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Karl G

Typecasting?

This topic is 5488 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

Hey everyone, I was wondering if there is time taken for typecasting a variable when it is already of the required type...such as: float variable = (float)0.0f; Thanks for your help, Karl

Share this post


Link to post
Share on other sites
Advertisement
The only typecasts that actually have to do work are converting between float, double and any integer based.

ints -> shorts -> chars/bytes are "free" since the compiler will probably use 32 bits for all of those anyway (except in char or short strings, but then you can only typecast the pointer which is another type of integer).

Share this post


Link to post
Share on other sites

  • 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!