Ive got this error
error C2059: syntax error : 'return'
Ive tried looking at what people with simmilar problems have posted but it doesnt seem to help me. The piece of code is a function im trying to use to make sure what is being entered is a double.
double getval()//function to enter values and check that they are numbers
{
double val=0;
char temp_val[15];
int v=1;
do while(v!=1)
{
cin.ignore(1);
cin.getline(temp_val,sizeof(temp_val));
istringstream Stream(temp_val);
if(Stream >> val)
{
v=1;
}
v=0;
cout <<"Your input was invalid please enter numbers only" << endl;
} return val;
}
Im pretty new to programming so please go easy on me if ive done something very stupid here.