标签: c sizeof
为什么sizeof()运算符为void类型返回1字节?
sizeof()
void
#include <stdio.h> int main() { void *v = 0; int *i = NULL; printf("%d\n", sizeof(*v)); printf("%d\n", sizeof(*i)); return 0; }
输出:
1 4