Assign string to an array value I need to assign a string to an array value:

char mystr[3] = "Hello";

But when I run this code on arduino simulator: tinkercad.com, I get this error:

1:17: error: initializer-string for array of chars is too long [-fpermissive]

Why I'm getting this error?
You have asked the compiler to allocate 3 char of memory, and then you ask it to fill that memory with 6 bytes of data (5 characters, plus null-char for termination.)