We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I'm using Real View C++ compiler and I want to use dynamic creation of object.
This code works fine:
CSomeObject * p_obj; CSomeObject obj; p_obj = &obj;
but this not:
CSomeObject * p_obj = new CSomeObject;
I don't know why. Can anybody help me how to solve this problem? I need second solution.
In what way does it not work?
Do you have any heap space defined?
I'm new to ARM. How to define heap?
Is it enough to change Heap_Size in Startup file? (I'm using LPC2148 microcontroler)
;// <h> Heap Configuration ;// <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF> ;// </h> Heap_Size EQU 0x00001000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit
Yes