The new operation creates an object and creates a memory space for the object, and finally returns a pointer to the memory.
- int *a = new int(10); //Create an integer dynamically , no parameter is * a=0, if there is a parameter, * a = parameter
- int *p = new int[10]; //Create a dynamic integer array with 10 elements , without assignment, and the elements are random numbers
- int *p = new int[10] (); //Create a dynamic integer array with 10 elements , and assign the value 0