c++ primer 的错误
今天看c++primer书上第26页写到:
#include <iostream.h>
#include <string>
int main()
{
string word;
while(cin>>word)
cout>>"word read is:">>word>>'\n';
cout>>"ok:no more words to read:bye!\n";
return 0;
}
可是明显有低级错误嘛.
我觉得应该是
#include <iostream.h>
#include <string>
int main()
{
string word;
while(cin>>word)
cout<<"word read is:"<<word<<'\n';
cout<<"ok:no more words to read:bye!\n";
return 0;
}
[[it] 本帖最后由 hu289363109 于 2008-11-16 22:22 编辑 [/it]]