Timeline for Arduino serial communication input string checking
Current License: CC BY-SA 3.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 6, 2016 at 20:56 | comment | added | Nick Gammon♦ | A String object isn't a pointer, so it can't contain a null pointer, per se. | |
Mar 6, 2016 at 20:51 | comment | added | James Waldby - jwpat7 |
It occurred to me after commenting that "null pointer" might be incorrect for String objects, but didn't know offhand.
|
|
Mar 6, 2016 at 20:50 | comment | added | Nick Gammon♦ | The empty string (ie. String with the default constructor). | |
Mar 6, 2016 at 18:37 | comment | added | Overdrivr | Thanks for the input, but then even with the sentence it's not entirely clear to me. 4th item will be initialized to nullpointer or String with empty constructor ? | |
Mar 6, 2016 at 18:10 | comment | added | James Waldby - jwpat7 |
No reason to doubt, just look it up. See paragraph 19 (the "all subobjects that are not initialized explicitly shall be initialized implicitly the same as objects that have static storage duration" sentence) in part 6.7.9 of the ISO/IEC N1570 C++ standard. The 4th item of String array[4] will be initialized to a null pointer if only three initializers appear.
|
|
Mar 6, 2016 at 9:59 | history | answered | Overdrivr | CC BY-SA 3.0 |