How can realloc not work but malloc can?

You are confusing size and pointer types. In the memory allocation size is the number of bytes, and you are converting the pointer type to float essentially creating an array of float of size size / sizeof(float) . In the memcpy-equivalent code, you are treating the array as float and copying size of them.

This will trash the heap, assuming that sizeof(float *) > 1 and is likely the source of later problems.

Judging from all the different bits of information (realloc not finding memory, memcpy behaving unexpectedly, crashes) this sounds much like a heap corruption. Without some code samples of exactly what you're doing it's hard to say for sure but it appears that you're mis-managing the memory at some point, causing the heap to get into an invalid state.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions