摘要:
关于VC++6.0中getline函数的一个bug 最近在调试程序时,发现getline函数在VC++6.0和其他编译器上运行结果不一样,比如有如下这段程序:#include <iostream>#include <string>using namespace std;int main(void){ string str; getline(cin,str); cout<<str<<endl; return 0;} 在VC++6.0下运行时,比如说输入“123”,需要按两次回车键才会输出“123”。 而在C-Free和VS2010下运... 阅读全文