Archived

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

Karl G

Typecasting?

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