I made a very basic program to try to better understand pointers but I cannot figure them out. I continue to get the error 'void celsius(double *)': cannot convert argument 1 from 'double' to 'double *'
#include <iostream>
using namespace std;
void celsius(double*);
int main() {
double temp;
double value;
cout << "Enter temperature in C ";
cin >> value;
temp = celsius(value);
cout << temp << endl;
return 0;
}
void celsius(double *par) {
double tem;
tem = (1.8 * par + 32);
return tem;
}
After referring to several resources I just cant figure out why it's returning the error. I know the error says it's because it can't convert a double to double* but examples I see online don't explain why.
Any help with the code or explanation be great. Thanks.