char *s; if (ptr == NULL) s = ""; else s = ptr; printf("File name: %s\n", s);