You want to change the pointer, i.e., the function need a reference, not a value. In C, this is done by giving the address (pointer) to the variable that is by change a pointer itsself. Thus, one pointer is for referencing, the other for you porgram logic.