标题:怎么会出错呢?
取消只看楼主
Noll_Nie
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:71
专家分:139
注 册:2011-4-19
结帖率:81.82%
已结贴  问题点数:20 回复次数:1 
怎么会出错呢?
error C2679: binary '<<' : no operator defined which takes a right-hand operand of type 'const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' (or there is no accep
table conversion)
这是什么意思啊?
指教下吧
2011-05-15 14:15
Noll_Nie
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:71
专家分:139
注 册:2011-4-19
得分:0 
程序代码:
#include <iostream>
using namespace std;

class Cbase  
{
public:
    void printtitle(void)const;
    string gettitle(string tit);
    virtual bool isgood() = 0;
    Cbase();
    virtual ~Cbase();

protected:
    string title;
    int volume_of_sales;
};
头文件
下面是实现文件
#include "base.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

Cbase::Cbase():title("NoTitle"),volume_of_sales(0)
{

}

Cbase::~Cbase()
{

}

string Cbase::gettitle(string tit)
{
    title = tit;
}

void Cbase::printtitle(void)const
{
    cout<<title<<endl;
}


编译报错啊???
2011-05-15 16:12



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




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

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