I have the following in the header file named vector.h
typedef struct coordinates coordinates;
Coordinates struct should have two variables. x
and y
How can I include these two variables x
and y
without changing anything in header file?
my idea was to write the following in main.c
coordinates{
int x;
int y;
};
I wrote above because I already wrote a typedef struct coordinates
in vector.h. So, if I write again, it is repeated. But the above syntax itself is wrong as compiler is throwing error. please help me if I understood structures wrong or help with how to declare variables inside the struct.