爲什麼cin.getline開始爲身體輸入的第二行工作,但打破了第一行? 範例程序運行: Enter name: Will
Enter body: hello world
hello again <= It accepts this one
char* name = new char[100];
char* body = new char[500];
std::cout << "
這是一個很奇怪的問題,當我的程序會詢問用戶的地址,而不是等待輸入跳過函數getline(),它似乎跳過函數getline()函數完全 Answerinput:
cout << "would you like to add another entry to the archive? (Y/N):";
cin >> answer;
cout << endl;
cout << endl;