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

memory allocation with new operator and program not working

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.

0