I have a quick question about type casting... I've been used to type casting like this:
float fFloat;
int iInt = 10;
fFloat = float(iInt);
And I have a feeling that doing this is a bad idea, yes or no? I think the correct way is:
float fFloat;
int iInt = 10;
fFloat = (float)iInt;
Is there a difference?
I have a feeling that the first example will create a new temporary variable in memory then delete it, while the second example will not (thus improving performance). If that is the case, is the compiler smart enough to optimise this and not create a temporary variable?