I’m seeing code allocating memory for float using sizeof(int).
I’m wondering whether sizeof(float) always equal to sizeof(int) on all architectures?
float *pointer2Float = (float *) USER_DEFINED_MALLOC (...,..., sizeof(int))
Note: this USER_DEFINED_MALLOC isa wrapper for conventional malloc, I think.
Thanks
Regards
No, there are implementations (mainly embedded systems) with 16-bit
intand 32-bitfloat.And of course, the sizes are allowed to be quite different per the standard.