我在C++中使用char命令缓冲区溢出时遇到问题,因为我是C++编码的新手。这是我的代码。我的问题在第七行。C++溢出缓冲区
#include "stdafx.h"
#include <iostream>
#include <cstdlib>
int main()
{
char word[90];
std::cout << "Type in your name to find out your gangster name!" << std::endl;
std::cin >> word;
std::cout << "Your gangster name is..." << std::endl;
std::cout << "Da" << word << std::endl;
system("pause");
}
如何让变量由无限量的字母组成?
为什么不改变'字符字[90]''到的std :: string word' –
'char'是不是“命令”。 –