在抛出 'std::bad_alloc' what() 实例后调用终止:std::bad_alloc 推回向量后

问题描述

我在这里遇到了一个问题,我已经声明了一个指向向量的指针。元素插入后,它显示我这个错误

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

这是我的代码:

vector<string>* strategies;

cout << "Name of the player 1 : ";
cin >> name;

strategies->push_back(name);

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)