新人。提示没有定义radius和high。

新人求助。。。提示没有定义radius和high。。
#include<iostream>
using namespace std;
double volume(double volume);
class cylinder
{
public:
cylinder(double radius,double high,double volume);
~cylinder();
void set(double radius,double high,double volume);
void show();
private:
double r;
double h;
double v;
};
cylinder::cylinder(double radius,double high,double volume)
{
r=radius;
h=high;
v=volume;
}
cylinder::~cylinder()
{
cout<<endl;
}
void cylinder::set(double radius,double high,double volume)
{
r=radius;
h=high;
v=volume;
}
void cylinder::show()
{
volume(v);
cout<<v<<endl;
}
double volume(double volume)
{
double pi=3.1415926;
volume=2*pi*radius*radius*high;
return 0;
}
int main()
{
cylinder cylinder1(12.5,11,25);
cylinder1.show();
return 0;
}
------解决思路----------------------
#include<iostream>
using namespace std;

class cylinder
{
public:
cylinder(double radius,double high,double volume);
~cylinder();
void set(double radius,double high,double volume);
void show();
double volume(double volume);//作为成员函数
private:
double r;
double h;
double v;
};
cylinder::cylinder(double radius,double high,double volume)
{
r=radius;
h=high;
v=volume;
}
double cylinder::volume(double volume)
{
double pi=3.1415926;
volume=2*pi*radius*radius*high;//再此处改为v=2*pi*r*r*h;就可以了
return 0;
}
//没声明当然就这样了,另外即然都已经用类了,最好就全部作为成员函数了
------解决思路----------------------
/*#include<iostream>
#include <cstdio>
#include<stack>
#include<cstring>
using namespace std;
int main()
{
int n;
while(cin>>n){
int cnt=0,max=0,tmp=0;
char ch;
stack<int> st;
int i=0;
bool *ans=new bool[n+1];
memset(ans,false,n);
while(i<n){
cin>>ch;
if(st.empty()&&ch==')'){
ans[i]=false;
}
else{
if(ch=='('){
st.push(i);
}
else{
int j=st.top();
st.pop();
ans[i]=ans[j]=true;//对应的项目赋真
}
}
i++;
}
for(i=0;i<n;i++){
if(ans[i]){
tmp++;
}
else{
if(tmp>max){
max=tmp;
cnt=1;
}
else if(tmp==max)
cnt++;
tmp=0;
}
}
if(tmp>max){
max=tmp;
cnt=1;
}
else if(tmp==max)
cnt++;
if(max>0)
cout<<max<<" "<<cnt<<endl;
else
cout<<0<<" "<<1<<endl;
delete []ans;
}
    return 0;
}*/
#include<iostream>
using namespace std;

class cylinder
{
public:
cylinder(double radius,double high,double volume);
~cylinder();
void set(double radius,double high,double volume);
void show();
double volume();
private:
double r;
double h;
double v;
};
cylinder::cylinder(double radius,double high,double volume)
{
r=radius;
h=high;
v=volume;
}
cylinder::~cylinder()
{
cout<<endl;
}
void cylinder::set(double radius,double high,double volume)
{
r=radius;
h=high;
v=volume;
}
void cylinder::show()
{
volume();
cout<<v<<endl;
}
double cylinder::volume()
{
double pi=3.1415926;
v=2*pi*r*r*h;
return 0;
}
int main()
{
cylinder cylinder1(12.5,11,25);
cylinder1.show();
return 0;
}
//对比一下我的改动
------解决思路----------------------
#include<iostream>
using namespace std;

class cylinder
{
public:
cylinder(double radius,double high,double volume);
~cylinder();
void set(double radius,double high,double volume);
void show();
double volume();
private:
double r;
double h;
double v;
};
cylinder::cylinder(double radius,double high,double volume)
{
r=radius;
h=high;
v=volume;
}
cylinder::~cylinder()
{
cout<<endl;
}
void cylinder::set(double radius,double high,double volume)
{
r=radius;
h=high;
v=volume;
}
void cylinder::show()
{
volume();
cout<<v<<endl;
}
double cylinder::volume()
{
double pi=3.1415926;
v=2*pi*r*r*h;
return 0;
}
int main()
{
cylinder cylinder1(12.5,11,25);
cylinder1.show();
return 0;
}
//对比一下我的改动