Answers for "how to check if a string pointer is empty in c"

C
0

how to check if a string pointer is empty in c

char *c = "";
if ((c != NULL) && (c[0] == '\0')) {
   printf("c is empty\n");
}
Posted by: Guest on April-20-2021

Code answers related to "how to check if a string pointer is empty in c"

Code answers related to "C"

Browse Popular Code Answers by Language