Apparently I failed to Call my struct. I have header file (header.h) where i defined my struct .
Header.h
Code:
struct theVar {
float x1, y1;
};
extern struct theVar global;
...
struct theVar compute (float x, float y){
float x1 = x + y;
float y1 = x * y;
struct theVar result;
result.x1;
result.y1;
return result;
}
and then in my C file, I call them :
file1.c
Code:
#include <header.h>
struct theVar global;
int main (){
struct theVar global = compute(3,4);
printf("x1 = %f \n", global.x1 );
printf("y1 = %f \n", global.y1);
}
But my program failed to call the value. What did I miss ?