What will be the output of the following C code? [code] #include <stdio.h> int main() { char *p = NULL; char

Tiên Hương

New member
What will be the output of the following C code?
Code:
    #include <stdio.h>
    int main()
    {
        char *p = NULL;
        char *q = 0;
        if (p)
            printf(" p ");
        else
            printf("nullp");
        if (q)
            printf("q\n");
        else
            printf(" nullq\n");
    }
A. nullp nullq
B. Depends on the compiler
C. x nullq where x can be p or nullp depending on the value of NULL
D. p q
 

Tìm kiếm

Back
Top