-1
这个问题令我烦恼。而不是等待输入,它只是关闭。我一直试图弄清楚这一点。有任何想法吗?C++输入流不等待输入提取运算符过载
istream& operator>>(istream& is, Account &a) {
cout << "Enter an accoutn number: ";
is >> a.accountNo;
cout << endl;
cout << "Balance: ";
is >> a.bal;
return is;
}
哎哟!哎哟!哎哟!哎哟!哎哟!哎哟!哎哟!哎哟!哎哟!哎哟!哎哟!哎哟! 不要在您的istream运算符中执行“cout”输出。那简直是邪恶。它让我头痛。 – 2010-06-12 15:56:58
你应该告诉我们你在哪里使用这个。它是'cin >> an_account;'?你能告诉我们更多的代码吗? – 2011-05-24 19:47:34