C | Data Types | Question 6

Output?

filter_none

edit
close

play_arrow

link
brightness_4
code

int main()
{
    void *vptr, v;
    v = 0;
    vptr = &v;
    printf("%v", *vptr);
    getchar();
    return 0;
}

chevron_right


(A) 0
(B) Compiler Error
(C) Garbage Value


Answer: (B)

Explanation: void is not a valid type for declaring variables. void * is valid though.

Quiz of this Question



My Personal Notes arrow_drop_up


Article Tags :
Practice Tags :


1


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.