c++问题:vector向量声明

包含了头文件了#include<vector>
vector<int>curve_y;
出错信息:
display.h(42) : error C2143: syntax error : missing ';' before '<'
display.h(42) : error C2501: 'vector' : missing storage-class or type specifiers
display.h(42) : error C2059: syntax error : '<'
display.h(42) : error C2238: unexpected token(s) preceding ';'
\Display.cpp(97) : error C2065: 'curve_y' : undeclared identifier
\Display.cpp(97) : error C2228: left of '.push_back' must have class/struct/union type
outline1View.cpp
display.h(42) : error C2143: syntax error : missing ';' before '<'
display.h(42) : error C2501: 'vector' : missing storage-class or type specifiers
display.h(42) : error C2059: syntax error : '<'
display.h(42) : error C2238: unexpected token(s) preceding ';'

using namespace std;加上这句
温馨提示:答案为网友推荐,仅供参考
相似回答