在 64 位操作系统下(LP64 / LLP64 模型),下面代码的输出结果是()。
#include <iostream>
using namespace std;
int main() {
int a[4] = {1, 2, 3, 4};
int (*p)[4] = &a;
int *q = a;
cout << sizeof(a) << " ";
cout << sizeof(p) << " ";
cout << sizeof(p + 1) << " ";
cout << sizeof(q + 1) << " ";
cout << (p + 1) - p << " ";
cout << (q + 1) - q << endl;
}
- A.
16 8 8 8 1 1 - B.
16 8 16 8 1 1 - C.
16 8 8 4 4 1 - D.
16 8 8 8 4 1