char msg[32];
void incr_ref(char*& ptr) { // reference to pointer
ptr++;
}
char* incr_ret(char* ptr) {
return ptr + 1; // or return ++ptr;
}
void incr(char** ptr) {
(*ptr)++; // increment the pointer that ptr points to
}
void setup() {
Serial.begin(9600);
strcpy(msg, "hello");
char* str = msg; // str points to "hello"
Serial.println(str);
incr(&str); // pass address of str
Serial.println(str);
incr_ref(str);
Serial.println(str);
str = incr_ret(str);
Serial.println(str);
}
void loop() {
// put your main code here, to run repeatedly:
}