-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Closed
Description
The following code compiled for an ARDUINO DUE leads to a different result than the code compiled for AVR-based ARDUINOS (IDE-Version: 1.6.3):
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!");
}
On an ARDUINO DUE the serial output is:
"This is a test"
"String hasn't changed!"
On AVR-based ARDUINOS the output is:
"This"
"String has changed!"
Metadata
Metadata
Assignees
Labels
No labels