a null-terminated string
How does a program know where a piece of text ends? In C the answer is a quiet marker at the end. A C string is just an array of characters with one extra rule: the real text is followed by a special end-marker character whose value is zero, called the null terminator (written '\0'). Reading a string means walking through the characters until you hit that zero byte — that byte is the 'stop here' sign.
So the word "cat" is stored as four bytes: 'c', 'a', 't', and then '\0'. The string literal in your source automatically adds that terminator for you, so "cat" needs an array of at least 4 chars. The null terminator is why functions like strlen() can compute a length without being told it — they count characters until the zero byte (and so strlen("cat") is 3, not counting the terminator). The standard string library in string.h is built entirely on this convention: strcpy() copies up to and including the terminator, strcmp() compares byte by byte until they differ or both hit zero.
Why this matters and the danger: this design is simple and memory-light, but it has famous pitfalls. If you forget to leave room for the terminator, or a string is missing its '\0', functions run off the end of the buffer searching for a zero that is not there — a buffer overflow, undefined behavior, and a classic security bug. Functions like strcpy() and gets() that trust the terminator blindly are dangerous; safer, length-bounded versions (like snprintf, or strncpy used carefully) exist precisely because the null-terminated design offers no built-in length protection.
char word[] = "cat"; /* stored as 'c','a','t','\0' : 4 bytes */ size_t n = strlen(word); /* 3 -- counts up to but not the '\0' */ char buf[3]; /* strcpy(buf, "cat"); would overflow: needs room for '\0' */
"cat" occupies 4 bytes because of the hidden '\0'. strlen counts the 3 visible characters. A 3-byte buffer has no room for the terminator.
A string needs one extra byte for its '\0', so room for n characters means an array of n+1. Functions that scan for the terminator (strcpy, strlen) run off the end if it is missing or the buffer is too small — a buffer overflow.