+ 2
Why size of void is 1
Empty class don't have any data members but size of that is 1 as it helps to have different memory address for different objects of empty class. What's the use of 1 byte for void ? https://code.sololearn.com/cpBKea4fS3wj/?ref=app
2 ответов
+ 3
compiler dependent answer..
https://www.sololearn.com/Discuss/1901493/?ref=app
+ 2
This is a side effect of GCC allowing arithmatic (addition/subtraction) on void and function pointers, as a non-standard extension.
See:
https://gcc.gnu.org/onlinedocs/gcc/Pointer-Arith.html