After reading here a lot of answers about C-style casting in C++ I still have one little question. Can I use C-style casting for built-in types like long x=(long)y;
long x=(long)y;
I think it may be OK given the context. Example:
/* Convert -1..1 to -32768..32767 */ short float_to_short(float f) { return (short)(max(-32768.f, min(32767.f, f * 32767.f))); }