Here is my code
double hour_payload_add(int entries , double array[])
{
int index=0 ,k=0;
int totalpayload=0;
double returnarray[entries/120];
while(k< entries)
{
totalpayload = totalpayload + array[k];
if(k%120==0)
{
returnarray[index] = totalpayload;
index++;
totalpayload=0;
}
}
return returnarray;
}
here I have called it
double hourgraph[hrentries];
hourgraph= hour_payload_add(entries , graph);
as I want to return an array what should I do to return without using pointers?