C language checks whether the string pointer is null

www‮uttual.‬ri.com
C language checks whether the string pointer is null
Example: check if a string pointer is empty  in C language

#include <stdio.h>
#include <stdlib.h>

int main()
{
    char *c = "";
    if ((c != NULL) && (c[0] == '\0')) {
       printf("c is empty\n");
    }
    return 0;
}
Created Time:2017-08-28 08:59:19  Author:lautturi