-1
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";
콘솔에는 암호 변수에 저장된 값 하나만 입력 할 수 있습니다. 이유는 무엇입니까?첫 번째 cin.getline 건너 뛰기
* 수백. 질문을하기 전에이 사이트를 조금만 검색하십시오. –
어쨌든 질문을 만든 바로 지금 "관련"을보십시오.) –
왜'std :: string' 대신 동적으로 할당하고 있습니까? –