error: expected ';' at end of declaration vector<int> sequence { 4, 5, 1, 3, 2 };
时间: 2024-01-05 12:04:25 浏览: 242
CentOS7运行.sh脚本提示syntax error: unexpected end of file的解决方法
5星 · 资源好评率100%
This error usually occurs when there is a missing semicolon at the end of a declaration. In your case, you can solve this error by adding a semicolon at the end of the line of code where the error occurs. Here's an example:
```cpp
vector<int> sequence { 4, 5, 1, 3, 2 }; // add semicolon at the end
```
This should fix the error.
阅读全文