[Solved] memcpy doesn’t copy anything or not?


Your array is not “empty”, despite your protestations. It just holds a very, very small value: Your machine uses the IEEE754 standard for representing floating points. In that standard, the word with all zeros represents the value 0.0. The next bigger word (i.e. the one obtained by adding 1 to the underlying bits) represents the next biggest floating point value, which is an extremely tiny, denormal value. When you printf this value to standard precision (6 decimal places?), it’s just rounded to zero.

Here’s a tangentially related answer of mine on a similar question.

3

solved memcpy doesn’t copy anything or not?