标题:大家帮我看一下,是什么错误,找半天了都找不到
取消只看楼主
x6988312
Rank: 1
等 级:新手上路
帖 子:46
专家分:5
注 册:2012-3-26
结帖率:100%
已结贴  问题点数:16 回复次数:1 
大家帮我看一下,是什么错误,找半天了都找不到
# include<iostream.h>
# include<string.h>
class strings
{
public:
    strings(string a);
private:
    char contents[50];
    int length;
};
strings::strings(string a)
{
    int l;
    char s[6]="hallo";
    l=length(s);
    cout<<"The original string and length"<<endl;
    cout<<s<<"  "<<l<<endl;
    contents=s+a;
    length=strlen(contents);
    cout<<" now string and length"<<endl;
    cout<<contents<<"  "<<length<<endl;
}
void main()
{
    strings sd;
    string a;
    cout<<"please input a string"<<endl;
    cin>>a;
    sd(a);
}
收到的鲜花
  • 寒风中的细雨2012-11-27 20:33 送鲜花  1朵   附言:编译下就知道什么错了
搜索更多相关主题的帖子: original void contents private include 
2012-11-27 19:49
x6988312
Rank: 1
等 级:新手上路
帖 子:46
专家分:5
注 册:2012-3-26
得分:0 
回复 2楼 mmmmmmmmmmmm
别的话不多说,我只想说,你是好人.....
2012-11-28 11:19



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




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

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