If a pointer is passed to a function, does it go out of scope when the function returns? Maybe a better way to ask would be, I send a pointer of array x to a function. The function does some stuff then increments the pointer. I know that since it's a pointer, any data that the pointer points to will stay changed, but will the pointer stay incremented (pointing to the next location in the array) after said function has ended? If not, then would 2 possible solutions to have it stay incremented be either looking up how to send a pointer pass-by-reference or use the pointer as the return value? Right now i'm sending an int by reference and using it to index the array, but it seems ugly and excessive since i'm sending a pointer already.