First, sorry my code didn't do what you expected
That was a stupid mistake/typo. In the second strtok()
call I had an empty terminator string (""
) where it should have contained a blank (" "
).
Corrected above - when you try to understand how the provided code works, it'd also be easy to spot the mistake
But for this
My code leaves the data in a "string variable" (dest
) - just not in a "String
variable/object" (or std::string
for that matter).
In C/C++ a string is nothing other than a series of characters in memory terminated with a zero-character. Even String
objects store their string contents in such an array.
But I personally refrain from using String
objects wherever possible on these tiny devices as they may lead to heap fragmentation and hence instability over time.