I'm trying to use the StackString-library which offers not to eat up RAM over time by re-assigning values to strings. I started from scratch and wrote a very basic democode which works. Then I added an assignment to a STackString-variable from a normal string or a function with return-value string See code below If I try to compile I get a compiler-error saying no matching function for call to 'Stack::StackString<50>::append(String&)'
here is the code
#include <StackString.hpp>
using namespace Stack; // it is very important to have this line of code. Otherwise the code won't compile
StackString<50> myString = StackString<50>("Hello, World!");
String NormalString = "1234Test";
void setup()
{
Serial.begin(115200);
Serial.println();
Serial.println();
Serial.println(myString.c_str());
myString.prepend("Everybody say: ");
Serial.println(myString.c_str());
myString.append(" How are you doing?");
Serial.println(myString.c_str());
Serial.println();
//myString = NormalString;
myString.append(NormalString);
}
void loop()
{ // put your main code here, to run repeatedly:
}
Do I have to do some typecasting? and if yes how does it look like? WHat I want to do is assigning a StackString a new value. This means the STackString is on the left side of the "=" assigning operator. I have tried different variants to no avail.
Could this be a problem of the special construction as a "namespace" ? No idea no clue
you find the STackString-library here: https://gitlab.com/arduino-libraries/stackstring
best regards
Stefan