Each time you want to use pointers instead of arrays, there is an obsessive-compulsive disorder in which it is inconvenient to use an array if the number of elements changes, but each time you replace an array with pointers, you will make a variety of errors:
First, the pointer is sure to initialize an address, there are two ways to initialize an address, the first one is to use new or malloc to allocate a memory, naturally generate an address, the second is to create an array, with the array of the first pointer to the value, so it seems that there is no meaning. So it is common to assign new or malloc.
Secondly, do not use int* i=&x; This form, this idea is wrong, because this is not an assignment, so change the address of the pointer, so that the i++ into a wild pointer. only with *i=x;
In summary, the use of pointers in place of arrays, and the principle of array storage is a dime.
int I, *p= (int*) (malloc (int) *10)); for (i = 0; i <; i++) {* (p+i) = i;} for (i = 0; i<10; i++) printf ("a[%d]=%d\n", I, p[i]);
Reflections on Array Pointers