| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3191 人关注过本帖
标题:error C2039: 'push_back' : is not a member of 'basic_string请问是怎么回 ...
只看楼主 加入收藏
韩雨航
Rank: 1
等 级:新手上路
帖 子:21
专家分:0
注 册:2012-1-12
结帖率:57.14%
收藏
已结贴  问题点数:20 回复次数:2 
error C2039: 'push_back' : is not a member of 'basic_string请问是怎么回事?
#include<iostream>
#include<fstream>
#include<algorithm>
#include<string>
using namespace std;
//----------------------
int main()
{
    ifstream in("remainder.txt");
    for(string s,t,u;in>>s>>t;u="")
    {
        sort(s.begin(),s.end());
        sort(t.begin(),t.end());
        cout<<s<<endl;
        cout<<t<<endl;
        set_difference(s.begin(),s.end(),t.begin(),t.end(),back_inserter(u));
        cout<<u<<endl;
    }
}

e:\vc6.0\microsoft visual studio\vc98\include\iterator(82) : error C2039: 'push_back' : is not a member of 'basic_string<char,struct std::char_traits<char>,class std::allocator<char> >'
        e:\vc6.0\microsoft visual studio\vc98\include\iterator(82) : while compiling class-template member function 'class std::back_insert_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > &__thiscal
l std::back_insert_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >::operator =(const char &)'
执行 cl.exe 时出错.

剩余串排列1.obj - 1 error(s), 0 warning(s)
搜索更多相关主题的帖子: microsoft studio include member 
2012-02-09 23:31
hahayezhe
Rank: 15Rank: 15Rank: 15Rank: 15Rank: 15
来 自:湖南张家界
等 级:贵宾
威 望:24
帖 子:1386
专家分:6999
注 册:2010-3-8
收藏
得分:20 
你把string当STL的容器用...
2012-02-10 08:30
韩雨航
Rank: 1
等 级:新手上路
帖 子:21
专家分:0
注 册:2012-1-12
收藏
得分:0 
回复 2楼 hahayezhe
请问怎么改?
2012-02-11 22:26
快速回复:error C2039: 'push_back' : is not a member of 'basic_string请问是 ...
数据加载中...
 
   



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

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