I'm using an ARDUINO DUE (IDE version 1.6.3)!
The following code
void setup() {
Serial.begin(115200);
}
void loop() {
printOnDisplay("This is a test");
while(1);
}
void printOnDisplay(char *string)
{
string[4] = 0;
Serial.println(string);
if (string[4]) Serial.println("String hasn't changed!");
else Serial.println("String has changed!");
}
leads to the output:
"This is a test"
"String hasn't changed!"