标题:谁指点一下下面的程序,,,,好郁闷的...谢谢..
取消只看楼主
sinpa12
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2007-11-16
 问题点数:0 回复次数:0 
谁指点一下下面的程序,,,,好郁闷的...谢谢..

#include<iostream.h>
class cylinder{
public:
cylinder ( double x,double y);
double get_volume ( double x,double y);
void vol ( );
private:
double radius,height;
double volume;
};

double cylinder::cylinder ( double x,double y){
radius=x; height=y;
}
double cylinder::get_volume ( double x,double y)
{
return volume=3.14*x*x*y;
}
void cylinder::vol ( )
{
cout<<"volume="<<volume<<endl;
}
void main(){
cylinder ob (2.0,3.0);
ob.vol();
}

请把你们的高见写下来...

搜索更多相关主题的帖子: private include public 
2007-11-16 02:09



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




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

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