Zitat Zitat von HaWe Beitrag anzeigen
Wirklich kompatibel zu ANSI-C char* wäre es nur, wenn du Strings an sich mit cstring-Funktionen verwenden könntest, also z.B.
Das wäre einfach zu erreichen (durch eine zusätzliche Memberfunktion in der Stringklasse). Aber da muss man die Arduinoentwickler in Schutz nehmen, dass sie den Zugriff mit ".c_str()" machen, genau wie std::string auch. Microsoft hat das in den 1990ern in seiner CString Klasse gemacht.
https://msdn.microsoft.com/en-us/lib...(v=vs.60).aspx
Das produziert mehr Probleme als es löst, deswegen macht man das heute nicht mehr so.

Zur Kritik an der Arduino String Klasse
https://forum.arduino.cc/index.php?topic=364772.0
When Arduino 1.0 was released, the "String" class was faulty due to compiler/library problems and could easily create wrong results and programs "hanging".

This problem was fixed at some point, I think with release of IDE 1.0.5.

So at least the "String" class is working "error free" now, if that was your question.

But of course "String" is BAD BAD BAD, because of:
- using more RAM than actually needed to solve any problem
- encourages programmers to write programs that eat up more RAM than is actually available
- slowing down program execution which might be bad if every microsecond is counting in your application
- fragments RAM, so that after some time of running an application the RAM could be fragmented too much, so that no "String" of certain length can be allocated any longer.
In C++ ist std::string nur ein typedef für std::basic_string<char>, wo schon der Name andeutet, dass da char drinstecken...
http://en.cppreference.com/w/cpp/string/basic_string