标题:c++程序为何编译不过?
取消只看楼主
David_o
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2012-2-23
结帖率:50%
 问题点数:0 回复次数:0 
c++程序为何编译不过?
程序代码:
#include <iostream>
using namespace std;

class test{
public:
    void print()
    {
        cout<<"health tooth"<<endl;
    }
};

class obj:public test{
public:
    void print()
    {
        cout<<"bad tooth"<<endl;
    }

};

int main()
{
    test* point= &obj;
    (obj*)point->print();
}
搜索更多相关主题的帖子: test 
2012-02-23 23:39



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




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

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