错误 C2065:'lO':用于声明向量值的未声明标识符?
error C2065: 'lO' : undeclared identifier for declaring a vector value?
>我不知道我在这里错过了什么。
我应该能够陈述一个向量并在其中输入值,对吧?
#include <iostream>
#include <string>
#include <vector>
using std::cout;
using std::cin;
using std::endl;
using std::string;
using namespace std;
int main()
{
cout << "Creating a lO element vector to hold scores.n";
vector<int> scores(lO, O); //initialize all l0 elements to O
cout << "Vector size is :" << scores.size() << endl;
cout << "Vector capacity is:" << scores.capacity() << endl;
cout << "Adding a score.n";
scores.push_back(O); //memory is reallocated to accommodate growth
cout << "Vector size is :" << scores.size() << endl;
cout << "Vector capacity is:" << scores.capacity() << endl;
return 0;
}
错误 1 错误 C2065:"lO":未声明的标识符 c:\users\ck\documents\visual Studio 2013\projects\project1\project1\vectortest.cpp 17 1 Project1错误 2 错误 C2065:"O":未声明的标识符 c:\users\ck\documents\visual Studio 2013\projects\project1\project1\vectortest.cpp 17 1 Project1错误 3 错误 C2065:"O":未声明的标识符 c:\users\ck\documents\visual Studio 2013\projects\project1\project1\vectortest.cpp 21 1 Project1
您使用字母 l (ell) 和 o (oh) 而不是数字 1 和 0。您需要对即时值使用数字。
相关文章:
- 在顶点着色器中使用 OpenGl 的未声明标识符,我在顶点着色器中绘制三角形时遇到问题
- Google protobuf 时间戳未声明标识符,在 Windows 上具有C++
- 我的函数调用 (C++) 中的未声明标识符
- 具有继承的未声明标识符(运算符 ostream)
- 无法确定 IDE 在 C++ 中说出未声明标识符的原因
- 错误 C2065:'lO':用于声明向量值的未声明标识符?
- 可变参数模板的未声明标识符
- 动态变量上的c++MACRO未声明标识符
- 指向对象的指针的未声明标识符向量
- 简单C++程序上的多个未声明标识符
- C++类"未声明标识符"
- 计算文本文件中的整数数(使用 fin>>x 的未声明标识符)
- 编译器错误 xcode 未声明标识符 C++
- 直接 X 11 纹理 FX 文件错误 X3004 未声明标识符"input"
- GCC 未声明标识符"_asm"
- ios_base类的C++未声明标识符
- 未声明标识符SQL_SS_TABLE
- 使用arrayfire的未声明标识符
- 未声明标识符和标识符未定义是什么意思?如何修复错误
- 在 MacOS 上使用 OpenMPI C++语法时未声明标识符'MPI'