The output of this snippet is 4 and 1. 4 is ok but why this 1 ????


int main()
        printf("%d %d",sizeof(NULL),sizeof(""));
        return 0;

Because "" represents the single null byte which always terminates a string in C.

ok got it, Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.