fstream file;
char *email=new char[100];
cout<<endl<<"enter email";
cin.getline(email,100);
char *password=new char[100];
cout<<endl<<"enter password";
cin.getline(password,100);
file.open("admin.txt",ios::out);
if(file.good())
{
file<<email<<"\n";
file<<password<<"\n";
}
cout<<"contents added";
控制台只允许输入一个保存在密码变量中的值,为什么?