Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - What are the methods of shaping to pointer shaping?
What are the methods of shaping to pointer shaping?
int * p = new int( 10); This process is to apply for an int-sized memory space, initialize it to 10, and then define one.

Shape pointer variable. Then assign the memory address of the new application to this plastic pointer.

int q = 10;

int * p = & ampq;

This process is to define a shaping data first, then define a shaping pointer, and finally put the address of the previously defined shaping data

Assign this pointer.

I don't understand the meaning of an object. Do you mean a class?

As for memory, both have to allocate memory, the difference is that the former array is allocated in heap space and the latter is allocated in stack space.