#include <iostream>
using namespace std;
//defining function
double distance(double,double);
int main() {
//where im having issues i think
cout << distance();
return 0;
}
//attempting to start the function with rate*time=distance and returning the value
double distance(double rate, double time)
{
time = 10;
rate = 10;
return time*rate;
}
main.cpp:9:11: error: no matching function for call to 'distance' cout << distance(); ^~~~~~~~ /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_iterator_base_funcs.h:138:5: note: candidate function template not viable: requires 2 arguments, but 0 were provided distance(_InputIterator __first, _InputIterator __last) ^ main.cpp:5:8: note: candidate function not viable: requires 2 arguments, but 0 were provided double distance(double,double); ^ 1 error generated. compiler exit status 1
this is what i got when i attempted to run it through. i understand this is pretty rudimentary but I'd like to have an understanding of what I did wrong before I continue
cout << distance(5.0, 10.0);. - Adrian Mole