When casting pointers however, there is no need to make a new, temporary variable with the new type, the compiler simply treats the original pointer as if it hade the requested type:
float * float_ptr = what_ever;
int * int_ptr = (int*)float_ptr;
This would generate space for 2 variables, the float_ptr and int_ptr vars. In the cast the generated code simply copies float_ptr into int_ptr, because at the assemply/machine level you dont have pointers to different types, you simply have pointers to some kind of data.
And also, someone (I think it was milo) said that the function
void foo(void){// do nothing];
generated the following sequence of assembly instructions:
push ebp
mov ebp, esp
pop ebp
ret 0
If this is true in an optimized build, then I suggest that you find a compiler that does a better job of optimizing.
With VC++ 6.0 it becomes (as it should be):
ret 0