C - Data Types - Discussion

You Are Here :: Home > C > Data Types - Discussion

 



Q.

What will be output of following c code?

#include
int main(){
int size;
size=sizeof(void);
printf("%d",size);
return 0;
}

A. 2 B. 0
C. 4 D. Compilation error

Answer: Option D
Explaination:

 


If we will try to find the size of void data type complier will show an error message “not type allowed”. We cannot use any storage class modifier with void data type so void data type doesn’t reserve any memory space. Hence we cannot declare any variable as of void type








Discussion

Your Comments Goes here...
NameDiscussion