help me find the error, and solve it!!! ASAP!!!!!!!!!!!

#include <iostream>
#include <cmath>
# define PI 3.14159
using namespace std;


void getRadius(double );
void volSphere(double, double & );
void volHemisphere(double &, double);
void print(double, double);
int main()

{
double radius,s, h;

cout<<"This program determines volume of a sphere and a hemisphere."<<endl;
getRadius(radius);
volSphere(radius,s);
volHemisphere(s,h);
print(s,h);
return 0 ;

}

void getRadius(double &radius)
{
cout<<"enter radius:";
cin>>radius;
}

void volSphere(double radius, double &s)
{

s= (4/3)*PI*(pow(radius,3));
}
void volHemisphere(double &sphere, double &h)
{

h = (1/2)*sphere;
}

void print(double s, double h)
{
cout<<"volume of sphere is"<<s<<endl;
cout<<"volume of hemi is"<<h<<endl;
}









output error is:
unresolved external symbol "void __cdecl volHemisphere(double &,double)" (?

volHemisphere@@YAXAANN@Z) referenced in function _main
unresolved external symbol "void __cdecl getRadius(double)" (?getRadius@@YAXN@Z) referenced in function _main




Last edited on
What error? You didn't post any output.
now i edit the new coding + output!!
Your prototype for volHemisphere doesn't match the function definition.
I am not to sure but in the declaration of

void volHemisphere(double &, double);
the second parameter is not a reference

but in the definition
void volHemisphere(double &sphere, double &h)
the second parameter is a reference

So VS thinks this a new function and not the one you declared. And since it thinks it is a new one it expects to get the definition of the old one.

Hope this helps :)
Topic archived. No new replies allowed.