Compare sting if (string1 != string 2) do something is always true?

Hello everyone i would like to programm a sub function to write text on my tft

BUT

it should only write when the “Text” it gest changed otherwise it does nothing…

but i runs always and write the text serveral times :confused:

why does my if (!=) run every time?
it should work like documented here:

#include <TFT_ST7735.h> //      https://github.com/sumotoy/TFT_ST7735/tree/1.0p1

char TFTTextStatus[13] = "ABCDEFGHIJKLM";

void setup() {}
void loop(){
tftwriteTEXT("TEST");
}

void tftwriteTEXT(char Str1[13]) {
[b] [/b] if (Str1 != TFTTextStatus)
  {
    tft.setCursor(0, 85);
    tft.setTextColor(BLACK);
    tft.print(TFTTextStatus);
    for (int i = 0; i < 14; i++)TFTTextStatus[i] = Str1[i];  //should run from 0 to 13 and copy string to global storage...
    tft.setTextColor(WHITE);
    tft.setCursor(0, 85);
    tft.print(Str1);
  }
}


Can any one help?

I did not post the whole programm as you need the tft display and the library referenced on the head of it to run

You can't compare C strings like that. Take a look at strcmp.

C strings are pointers to char. Pointer equality is nothing to do with what's pointed at, its purely a
comparison between two addresses.

This means that s1 == s2 implies either that s1 and s2 are identically the same string in the
same address in memory, or they are both NULL, or they are both bogus identical addresses
(which may fault if accessed).

s1 != s2 doesn't really tell you anything about the strings s1 and s2 at all.

If strcmp (s1, s2) == 0, you can infer that s1 and s2 point to identical strings, but may or may
not be the same address, and may or may not be NULL (since deferencing NULL is completely
undefined).