double volume(double l,double w,double h);
double area(double l,double w,double h);
int main() {
double l,w,h,v,a`;
volume (3.0,1.5,2.0);
area(3.0,1.5,2.0);
printf("The Volume is %lf cubic meters and the area is %lf square meters.\n", v,a);
return 0;
}
double volume(double l,double w,double h) {
double v;
v = l*w*h;
return v;
}
double area(double l,double w,double h) {
double a;
a = (2*l*w) + (2*w*h) + (2*l*h);
return a;
}
体积是2091994552961492532068352.000000
立方米,面积是637485042878638687518720.000000
平方米。
我目前正在获得上述输出(这显然是错误的,并且是垃圾值),我想知道我哪里出错了。我猜这是一个指针问题。如果您可以向我解释指针的基础知识,我将不胜感激。提前致谢。