标题:哪位帮帮我
取消只看楼主
nzl
Rank: 1
来 自:湖北荆门
等 级:新手上路
帖 子:11
专家分:0
注 册:2008-10-10
 问题点数:0 回复次数:0 
哪位帮帮我

#include<iostream.h>
#include<string.h>
class people
{
public:
    char getname(char *name)
    {
        //strcpy(m_name,name);
        return m_name;
    };
    char getsex(char *sex)
    {
        //strcpy(m_sex,sex);
        return m_sex;
    };
    int getage(int age)
    {
        m_age=age;
        return m_age;
    };
private:
    char m_name;
    char m_sex;
    int m_age;
};
class student:public people
{
public:
    void get(){};
    int getnum(int num)
    {
        m_num=num;
        return m_num;
    };
private:
    int m_num;
};
void main()
{
    student a;
    cout<<a.getnum(0045)<<endl;
    cout<<a.getname("张伟")<<endl;
    cout<<a.getsex("男")<<endl;
    cout<<a.getage(18)<<endl;
}
生成目标文件没有错误,但生成可执行文件是就有一个错误了。苦啊!!!!!!
搜索更多相关主题的帖子: TAG 
2008-12-14 15:28



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




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

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