Hi,
I have following piece of code:
jsonData is a json string.
String *getDepartures(String jsonData) {
String departures[] = {jsonData.substring(49, 54), jsonData.substring(99, 104)};
Serial.println(departures[0]);
Serial.println(departures[1]);
return departures;
}
the output here is e.g.
17:40
17:55
both as string. Then I try to return the data and check the output again.
void loop() {
String *departures = getDepartures(runCurl());
Serial.println(departures[0]);
}
The output here is then like
:40 but I aspected 17:40
I tried to understand the pointer stuff but ... ![]()
This part for me is clear. That is similar to PHP for me, or I'm completely wrong.
String departures[] = {jsonData.substring(49, 54), jsonData.substring(99, 104)};
Serial.println(departures[0]);
Serial.println(departures[1]);
Some thing on the return of the string is wrong.
small help would be great. Thanks.