情况为在代码中使用 STL 库中的 vector 模板时出错,编译没报错,执行可执行文件时报错
源代码:
#include<iostream> #include<vector> using namespace std; int main(){ vector<int> a; int cap = a.capacity(); cout<<cap<<endl; for(int i = 0; i<=cap;i++){ a.push_back(1); } cout<<a.capacity()<<endl; return 0; } 出错信息: 无法定位程序输入点_gxx_personality_sj0 于动态链接库...\a.exe(可执行文件所在目录)
不知道哪里出错了,不使用 vector 模板可以正常运行,该怎么解决呢,谢谢大家了!
