New course! Every coder should learn Generative AI!
Try a free lesson+ 8
sameer it's an gcc specific feature according to which size of void is 1
http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Pointer-Arith.html#Pointer-Arith
The sizeof operator shall not be applied to an expression that has function type or an incomplete type, to the parenthesized name of such a type void
In C, sizeof(void) == 1 in GCC, but this appears to depend on your compiler.
In C++, compilation terminated due to -fatal-errors which came due to wrong syntax
so it's an compiler dependent answer