I got a small program here, I am just trying to return a string value from a function through a reference parameter but I keep getting an error. Any help or tips will be appreciated
#include<iostream>
using namespace std;
int timesTen(int, string&);
int main()
{
int number = 6, product;
string outcome = "positive";
product= timesTen(number,outcome);
cout << product << endl;
return 0;
}
int timesTen(int value, string &result)
{
int product;
if ( value < 0)
result = "negative";
cout << result << endl;
product = (value*10);
return product;
}