i have a question
Write a function that returns a pointer to the maximum value of an array of floating-point data:
double* maximum(double a[], int a_size)
If a_size is 0, return NULL.
first of all i don't want the code for the entire program .. can someone tell me how do we create a pointer function like double*maximum(double a[],int a_size) i just remember doing double maximum dun knw how to do double*maximum.... any kind of help will be greatly appreciated ... have this due within next 16 hrs ...
this is what i have got so far : it is for vector ... i cant figure it out how to do it for a pointer array
double max(vector<double> v)
{
int i;
double max = v[0];
for(i = 1; i < v.size(); i++)
{
if(max < v[i])
max = v[i];
}
return max;
}
how would u do this for an array and instead of double max how would do it for double* max like the problem mentioned