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

ifstream的使用

asdjc 发布于 2010-03-27 11:29, 964 次点击
    ifstream fin("name.txt");
     string s;
    while((fin>>s))
        ht.insert(s);
这段代码有麽问题?
8 回复
#2
hzh5122010-03-27 12:22
版主大人,ht 是什么?
#3
hahayezhe2010-03-27 13:59
路过
#4
wangboa1232010-03-27 14:16
应该没问题
#5
ph66519882010-03-27 15:42
很多东西都没写出来,无法判断
#6
asdjc2010-03-27 19:44
是这样的,ht是一个类对象,ht.insert(s);是将s字符串加入ht对象中,具体没写,其它的东西没问题。
#7
asdjc2010-03-27 19:57
这是错误提示。
ifstream fin("name.txt");   二进制“>>”: 没有找到接受“std::string”类型的右操作数的运算符(或没有可接受的转换)
请大家帮哈。
#8
谈笑风生2010-03-28 17:51
路过
#9
谈笑风生2010-03-28 17:51
路过
1