请问在类中可以 定义静态的vector容器吗?在类example.h中声明了static std::vector <int> vec(5); 在example.cpp中定义了 std::vector <int> Example::vec(5,0),结果编译的时候出错,请问该怎样定义?[解决办法]声明中不要带初始化参数。改为: static std::vector <int> vec;