Typecasting?

Started by
1 comment, last by Karl G 20 years, 9 months ago
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
Advertisement
You compiler should ignore the typecast since it is useless.


Qui fut tout, et qui ne fut rien
Invader''s Realm
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).

This topic is closed to new replies.

Advertisement