how to check if a string pointer is empty in c

Solutions on MaxInterview for how to check if a string pointer is empty in c by the best coders in the world

showing results for - "how to check if a string pointer is empty in c"
Matteo
27 Sep 2020
1char *c = "";
2if ((c != NULL) && (c[0] == '\0')) {
3   printf("c is empty\n");
4}