Yes, you need to add the trailing '\ 0' (not NULL, by the way) yourself - C does this only for string literals , and not for any array.
For instance -
char* str = "12345";
There will be an array with 6 characters, the sixth is '\ 0'.
The same for -
char str[] = "12345";
He will have 6 elements.
BUT -
char str[] = { '1', '2', '3', '4', '5' };
Will have exactly 5 elements without a trailing '\ 0'.
(in your initialization in the question, you already have "\ 0", so you don't need anything else).
source share