注册 登录
编程论坛 C++教室

帮看程序中的一句什么意思;

kscooh1 发布于 2011-10-19 15:05, 665 次点击
程序如下:
程序代码:
void restricted_wc(ifstream &removeFile,map<string,int> &wordCount)
{
    vector<string> excluded;
    string removeWord;
    while(removeFile>>removeWord)  这括号中的是什么意思,书上都饿这么写的 ,没说明什么意思。看不懂
        excluded.push_back(removeWord);

    cout<<"Enter text(Ctrl+z to end):"<<endl;
    string word;
    while(cin>>word)
    {
        bool find=false;
        vector<string>::iterator iter=excluded.begin();
        while(iter!=excluded.end())
        {
            if(*iter==word)
            {
                find=true;
                break;
            }
            ++iter;
        }
        if(!find)
            ++wordCount[word];
    }
}

1 回复
#2
tisyang2011-10-19 17:16
读取第一条“字面量“字符串存入变量removeWord 中
这里所谓的字面量是指 以空白符分隔的
1