Eralt / arduino

Automatically exported from code.google.com/p/arduino
0 stars 0 forks source link

String Library Function toCharArray() doesn't behave as documented #404

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

http://arduino.cc/en/Reference/StringToCharArray

Documented usage:
string.toCharArray()

Actual usage:
 stringThree.toCharArray(charResult, sizeof(charResult));

Original issue reported on code.google.com by rick.rickanderson on 16 Nov 2010 at 12:14

GoogleCodeExporter commented 9 years ago
I added the following to the WString.h and WString.cpp files to make it match 
the documentation.

WString.h:
char* toCharArray();

WString.cpp:
char* String::toCharArray()
{
    return _buffer;
}

Original comment by c...@chetos.net on 14 Dec 2010 at 4:32