'cout << function(); undefined reference. issues with a function

#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

c++


Solution 1:[1]

At least pass the parameters when you are calling the function since your function needs to params

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Desmond9989