我知道sizeof
从不计算它的操作数,除非在特定的情况下,所述操作数是VLA。或者,我以为我知道。
void g(int n) {
printf("g(%d)\n", n);
}
int main(void) {
int i = 12;
char arr[i]; // VLA
(void)sizeof *(g(1), &arr); // Prints "g(1)"
(void)sizeof (g(2), arr); // Prints nothing
return 0;
}
怎么一回事?
https://stackoverflow.com/questions/31027237
复制相似问题