I want to return an array, and since it doesn't matter if it gets overwritten, my method is this:
double * kryds(double linje_1[], double linje_2[]){
double x = linje_1[1]*linje_2[2]-linje_1[2]*linje_2[1];
double y = linje_1[2]*linje_2[0]-linje_1[0]*linje_2[2];
double z = linje_1[0]*linje_2[1]-linje_1[1]*linje_2[0];
static double svar[] = {x, y, z};
return svar;
}
However, I get an error at the static double svar[] = {x, y, z};
. Can someone please explain what it means? I've read other forum posts like this one but that doesn't really apply to my case