-->
当前位置:首页 > 题库

单选题:What is wrong in the following code?

Luz5年前 (2021-05-10)题库1124
What is wrong in the following code?

```
vector v;
v[0] = 2.5; @[C](2)
```

A. The program has a compile error because there are no elements in the vector.
B. The program has a compile error because you cannot assign a double value to v[0].
C. The program has a runtime error because there are no elements in the vector.
D. The program has a runtime error because you cannot assign a double value to v[0].




A.The program has a compile error because there are no elements in the vector.
B.The program has a compile error because you cannot assign a double value to v[0].
C.The program has a runtime error because there are no elements in the vector.
D.The program has a runtime error because you cannot assign a double value to v[0].


答案:C