标题:c++ primer 的错误
取消只看楼主
hu289363109
Rank: 1
来 自:重庆
等 级:新手上路
帖 子:7
专家分:0
注 册:2008-4-15
 问题点数:0 回复次数:0 
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]]
搜索更多相关主题的帖子: primer 
2008-11-16 22:19



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-244679-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.559375 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved