结构体数组的默认值

单选题 难度 3

#struct#array

只改了其中一个元素。

题目

下面代码的输出是( )。

struct P { int x = 0; };
// main: P a[3];  a[1].x = 5;  cout << a[0].x << a[1].x << a[2].x << endl;
  1. 050
  2. 555
  3. 000
  4. 500
来小码星球,动手写一遍 →