i'm required to find the nth root by creating a function
that uses a value pointed by pointer double *num
passed as an argument to the function
and returns a double pointer to the result
i'm trying to pass an empty pointer and assign a value to it which is the result then dereference it getting back the result but there is a problem i can't figure
#include <math.h>
int main () {
double *returnPointer=NULL;
double *res=NULL;
double num=50;
double *rootnth(double *, int, double *);
res = rootnth(&num, 7, returnPointer);
printf("%lf", *res);
return 0;
}
double *rootnth(double *num, int n, double *returnPointer) {
*returnPointer= pow(*num,(float)1/n);
return returnPointer;
}