can anyone help im getting these errors:
1>hw16.obj : error LNK2001: unresolved external symbol "double __cdecl computeDistance(double)" (?computeDistance@@YANN@Z)
1>C:\Users\Ryan\Documents\Visual Studio 2010\Projects\hw16\Debug\hw16.exe : fatal error LNK1120: 1 unresolved externals
here is the code:
#include <iostream>
#include <iomanip>
using namespace std;
int getInput();
double computeDistance(double distance);
int main(){
int seconds;
double distance;
cout<<"Welcome to falling distance computation program"<<endl;
seconds=getInput();
cout<<seconds<<" woohoo"<<endl;
distance = computeDistance(seconds);
//cout<<"hello"<<distance<<endl;
return 0;
}
int getInput(){
int seconds;
cout<<"How long has the obect been falling(seconds)?"<<endl;
cin>>seconds;
return seconds;
}
double computeDistance(int seconds){
double distance;
distance = seconds*9.8;
return distance;
solved it myself:
the function prototype double computeDistance(double distance);
should read double computeDistance(int);
im a noob, but not forever!