If you want to reassign what the pointer points to in C, you have to use int**
, ie a pointer to a pointer.
That is because pointers are copied by value as arguments, so if want the change made in the pointers pointee to be visible outside the scope of the function, you need another level of indirection.