-3
这是我的代码。编译完成后,控制台启动,但立即崩溃,说名称已经停止工作。警告:扩展初始化程序列表仅在-std = C++ 11或-std = gnu ++ 11时可用。 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\编译时C++程序崩溃
#include<iostream>
#include<conio.h>
#include<string> //introducing string classes.
struct cia
{
std::string name;
std::string code;
float balance;
};
int main()
{
using namespace std;
cia agent[10] =
{
agent[0] =
{ "wallflower",
"007860",
300000
},
agent[1] =
{
"albus",
"117861",
310000
},
agent[2] =
{
"severus",
"227862",
600000
},
agent[3] =
{
"enigma",
"337862",
550000
},
};
string head="\n\t\t\t\t\tCIA";
string username;
string pass;
cout<<head;
cout<<"\n Welcome To The Most Secure network of Justice.";
cout<<"Username-; ";
cin>>username;
getch();
}
程序崩溃只有* *后,他们已经被编译。在编译之前,它们不能运行,所以它们不能崩溃。 –
是的,但在编译之后,它立即停止。我的意思是说控制台(CMD)崩溃。 –
你是如何编译程序的?你的编译器命令行是什么样的?你在使用什么编译器(以及哪个版本)? –