what happpened when casting
-
Hi, suppose there are to struct type, struct small { float x; double y; }; struct large { int x; float y; double z; bool w; }; and in my program I coding as this: large b; small *p =(small) b; what's going on inside the code operation? Thank you. Best regard. I confess that I am a stubborn guy, but why not put things thoroughly, logically and systematically clean. One concrete prolem is worth a thousand unapplied abstractions.
-
Hi, suppose there are to struct type, struct small { float x; double y; }; struct large { int x; float y; double z; bool w; }; and in my program I coding as this: large b; small *p =(small) b; what's going on inside the code operation? Thank you. Best regard. I confess that I am a stubborn guy, but why not put things thoroughly, logically and systematically clean. One concrete prolem is worth a thousand unapplied abstractions.
NicholasCougar wrote: small *p =(small) b; This won't even compile. You are attempting to assign small to small*,( via unsafe casting). Nish
The posting stats are now in PDF:- http://www.busterboy.org/codeproject/ Feel free to make your comments. Updated - May 04th, Saturday