It is commonly used for strings. When you use a string literal for something like cout << "asdf", it sees the string as only a pointer to the first character. cout then goes through the string until it sees a \0 character, which is automatically added after the f, and once it sees that it knows it has reached the end of the string.