Store pointer value
问题 As I know, when a pointer is passed into a function, it becomes merely a copy of the real pointer. Now, I want the real pointer to be changed without having to return a pointer from a function. For example: int *ptr; void allocateMemory(int *pointer) { pointer = malloc(sizeof(int)); } allocateMemory(ptr); Another thing, which is, how can I allocate memory to 2 or more dimensional arrays? Not by subscript, but by pointer arithmetic. Is this: int array[2][3]; array[2][1] = 10; the same as: int