Check if the first character is '\0'. You should also probably check if your pointer is NULL.

char *c = "";
if ((c != NULL) && (c[0] == '\0')) {
   printf("c is empty\n");
}

You could put both of those checks in a function to make it convenient and easy to reuse.

Edit: In the if statement can be read like this, "If c is not zero and the first character of character array 'c' is not '\0' or zero, then...".

The && simply combines the two conditions. It is basically like saying this:

if (c != NULL) { /* AND (or &&) */
    if (c[0] == '\0') {
        printf("c is empty\n");
    }
}

You may want to get a good C programming book if that is not clear to you. I could recommend a book called "The C Programming Language".

The shortest version equivalent to the above would be:

if (c && !c[0]) {
  printf("c is empty\n");
}
Answer from codemaker on Stack Overflow
๐ŸŒ
Cprogramming
cboard.cprogramming.com โ€บ c-programming โ€บ 59741-how-check-if-char*-empty-null.html
How to check if char* is empty or null??
December 14, 2004 - It is only empty if it doesnt contain a character (except \0), if the value is " " then it contains a space, which is a character. Check if its NULL, Empty (only '\0'), if its not either see if it contains other characters besides a white space.
Discussions

How to check if C string is empty - Stack Overflow
Since C-style strings are always terminated with the null character (\0), you can check whether the string is empty by writing ... Note that strcmp returns a nonzero value if the strings are different and 0 if they're the same, so this loop continues to loop until the string is empty. Hope this helps! ... Sign up to request clarification or ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
c - Best way to check if a character array is empty - Stack Overflow
The second method would almost ... a null-terminated string is empty, since it involves one read and one comparison. There's certainly nothing wrong with this approach in this case, so you may as well use it. The third method doesn't check whether a character array is empty; ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
c - How to properly check for null character - Stack Overflow
Having read through some of the answers to this same question posted on the website, I've found that I apparently have made no mistakes when coding this check up. Never-the-less, I keep getting war... More on stackoverflow.com
๐ŸŒ stackoverflow.com
How to know if a char array has a null element in C? - Stack Overflow
Say if I have : unsigned char* str = "k0kg" And 0 is the null element. When I loop through it using a for loop, how do I check if the array has a null? I tried: if (str[1]==0): I also tr... More on stackoverflow.com
๐ŸŒ stackoverflow.com
๐ŸŒ
Sabe
sabe.io โ€บ blog โ€บ c-check-string-empty
How to Check if a String is Empty in C - Sabe.io
March 19, 2022 - Therefore, if the length of the string is 0, then the first character of the string is a null character. ... CLIKE#include <stdio.h> #include <string.h> int main() { char string[] = ""; if (string[0] == '\0') { printf("String is empty"); } else ...
๐ŸŒ
Programiz
programiz.com โ€บ cpp-programming โ€บ library-function โ€บ cctype โ€บ isblank
C++ isblank() - C++ Standard Library
The isblank() function returns non zero value if ch is a blank character, otherwise returns zero. #include <cctype> #include <iostream> #include <cstring> using namespace std; int main() { char str[] = "Hello, I am here."; int count = 0; for (int i=0; i<=strlen(str); i++) { if (isblank(str[i])) ...
๐ŸŒ
C For Dummies
c-for-dummies.com โ€บ blog
Null Versus Empty Strings | C For Dummies Blog
August 12, 2017 - You must compare the two: Create an empty string or null string as a sample, then use the strcmp() function to compare them. A null string compares to another null string, and an empty string to an empty one. #include <stdio.h> #include <string.h> int main() { char empty[5] = { '\0' }; char ...
๐ŸŒ
Quora
quora.com โ€บ How-do-I-check-if-a-char-array-is-empty
How to check if a char array is empty - Quora
... โ€œEmptyโ€ as C-style string: first element is the null terminator ('\0'), so the string contents are empty. โ€œAll elements zero/blankโ€: every element equals '\0' or some whitespace value.
๐ŸŒ
Reactgo
reactgo.com โ€บ home โ€บ how to check if a string is empty in c
How to check if a string is empty in C | Reactgo
March 8, 2023 - To check if a given string is empty or not, we can use the strlen() function in C. The strlen() function takes the string as an argument and returns the total number of characters in a given string, so if that function returns 0 then the given ...
Find elsewhere
๐ŸŒ
TutorialKart
tutorialkart.com โ€บ c-programming โ€บ how-to-check-if-a-string-is-empty-in-c
How to Check if a String is Empty in C - Examples
February 21, 2025 - In this example, we compare the string with an empty string using strcmp() from string.h. ... #include <stdio.h> #include <string.h> int main() { char str[] = ""; // Compare string with an empty string if (strcmp(str, "") == 0) { printf("The string is empty.\n"); } else { printf("The string is not empty.\n"); } return 0; }
๐ŸŒ
Wikihow
wikihow.com โ€บ computers and electronics โ€บ software โ€บ programming โ€บ c programming languages โ€บ how to check null in c: 7 steps (with pictures) - wikihow
How to Check Null in C: 7 Steps (with Pictures) - wikiHow
June 9, 2025 - It's common practice to set newly created or newly freed pointers to NULL to make sure you don't use this unhelpful address by accident. Avoid this mistake: char *ptr; if(ptr == NULL) { //This will return FALSE.
๐ŸŒ
Arduino Forum
forum.arduino.cc โ€บ projects โ€บ programming
How to check if a char array is blank (or at least 20 ?)<< SOLVED>> - Programming - Arduino Forum
January 21, 2022 - This is a small test sketch : I only want to print these lines if they contain anything: Would anyone please assist me. Many thanks in advance. char line0 [19]; char line1 [19]; char line2 [19]; char line3 [19]; void setup() { Serial.begin(9600); while (!Serial); // wait for serial connection ...
๐ŸŒ
Quora
quora.com โ€บ Whats-the-simplest-way-to-check-whether-a-char-array-is-null-in-C++
What's the simplest way to check whether a char array is null in C++? - Quora
Answer (1 of 4): As Davidโ€™s answer explains โ€” it is important to distinguish whether you are checking values in an array, or checking if a label has allocated storage. You have to have storage to store anything. Sounds dumb, and circular, but believe me it is the number one newbie mistake in C a...
๐ŸŒ
DaniWeb
daniweb.com โ€บ programming โ€บ software-development โ€บ threads โ€บ 425629 โ€บ how-to-check-null-character-in-an-array
java - How to check NULL character in an array [SOLVED] | DaniWeb
June 14, 2012 - In Java char is a 16 bit unsigned numeric value, so zero is perfectly valid anywhere, but the Java equivalent of your loop wold be something like for (int i = 0; my-char-array[i] != 0; i++) {... of course that will give an array index out of bounds if the array โ€ฆ โ€” JamesCherrill 4,733 Jump to Post ยท I don't think an array of char can have an element that is null.