I found an example sketch on the internet what has the following:
String command = ""
Okay, so command is a String object that is currently empty.
Then there is a function declared as follows:
int readSeralInputCommnad(String * ptr);
This function takes as an input a pointer to a String object.
readSerialInputCommand( ) is called as follows:
serialResult = readSerialInputCommand(&command);
This means that the address of command is being passed in which is what a pointer is.
So far so good. I understand it up to this point.
Inside readSerialInputCommand( ) function is
*ptr = *ptr + Serial.read( );
Serial.read( ) reads a byte, but the *ptr = *ptr + Serial.read( ); totally confuses me.
What is happening there?
The sketch works, but I want to understand it better.