If I get anything wrong, let me know. :)
I'm wondering what is better. Using a "temporary" String to send text to a function. -or- Store the text in a C string and then send that to a function.
I'm using the UTFT library to display stuff to my screen.
The manual says send a String or C string (which is a char array) to the print function.
So if all I want to do is print the same text every time I click a button. Which of these uses less memory and uses the memory the most responsibly?
myGLCD.print("Hello World!", 10, 150);
const char myText = "Hello World!"; myGLCD.print(myText, 10, 150);
The reason I also ask is because the compiler throws this error for the first example: ISO C++ forbids converting a string constant to 'char*'
My understanding of String and C string comes from this - https://hackingmajenkoblog.wordpress.com/2016/02/04/the-evils-of-arduino-strings/
But it doesn't cover what to do when you just need to send a simple text to a function. .