//Empty strings
char someEmptyString[] = "";
char *anotherEmptyString = nullptr;
//an empty string has the terminating zero at index 0
if (someEmptyString[0] == '\0') {
printf("someEmptyString is empty\n");
}
size_t length = strlen(someEmptyString);
//length is 0
//a null pointer is not a string at all: check it first
if (anotherEmptyString == nullptr || anotherEmptyString[0] == '\0') {
printf("anotherEmptyString is empty\n");
}
printf("length is %zu\n", length);