I want to be able to send variable text strings to an LCD. I want to put the text in a variable then call the LCD handler function I am creating. I have done this thus far
char LCDMessage[200] = " "; //allocate space for 200 characters
Later in various places where I want to call the LCD handler I do the following
strcpy(LCDMessage, "some text")
then call the LCD handler which does the following (among other things)
Serial.print(LCDMessage)
All of this works fine but I would love to have the available space I have allocated to LCDMessage be variable. Perhaps I define it to be 200 characters and then inadvertently send 205 characters...oops!
Is there a way to make this more dynamic? Am I going about the string handling in the right way to begin with?