I know that i have to define at the beginning of the function what type it is supposed to return, but i dont know how to do it with pointer.. i try to do it like this with int * but its not working
int *sorting(int Num_Gaag, FILE *f) {
typedef struct {
int x;
int y;
int size;
float power;
} gaag;
gaag *arrgaags;
int i = 0, j;
int counter = 0;
arrgaags = malloc(sizeof(gaag) * Num_Gaag);
fseek(f, 67, SEEK_SET);
for (i = 0; i < Num_Gaag; i++)
fscanf_s(f, "(%d,%d) \t%d\t%f\n", &arrgaags[i].x, &arrgaags[i].y,
&arrgaags[i].size, &arrgaags[i].power);
return *arrgaags;
}
thank you!
int *or agaag *? Your minimal reproducible example is very unclear.gaag*outside of the function if its definition is only visible inside the function, even if you could somehow return it.arrgaagsif the function returns anintorint *;arrgaags(that sounds like a cry for help!) is a pointer to a structure type that is not accessible outside this function.