This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

C++ dynamic memory allocation, pointer address initialized to 0x0

Hi,

I am trying to port some C++ code that uses dynamic memory allocation for a few temporary float arrays. When I am in debugging mode, I notice that when the array pointers are instantiated, they all point to address 0x0. Why is this happening? I would expect that the address to which each pointer points is different and is located somewhere in the heap memory region. I am using the following code to create a dynamically allocated array:

float* this_bin = new float[num_fft_bins];

Parents
  • Eventually I was able to resolve the issue, the heap size in the scatter file had not been setup correctly. As a result, there was not enough memory and the malloc function was returning a null pointer address value.

Reply
  • Eventually I was able to resolve the issue, the heap size in the scatter file had not been setup correctly. As a result, there was not enough memory and the malloc function was returning a null pointer address value.

Children