下列 C++ 代码的输出是( )。
#include <iostream>
using namespace std;
int main() {
int arr[5] = {2, 4, 6, 8, 10};
int * p = arr + 2;
cout << p[3] << endl;
return 0;
}
- A.
6 - B.
8 - C. 编译出错,无法运行。
- D. 不确定,可能发生运行时异常。
g7-02444.in输出g7-02444.out下列 C++ 代码的输出是( )。
#include <iostream>
using namespace std;
int main() {
int arr[5] = {2, 4, 6, 8, 10};
int * p = arr + 2;
cout << p[3] << endl;
return 0;
}
68