Hi there, First post on the forum.
I would be very greatful if someone could explain why im getting an error message with the function prototypes, and how can i fix this? Thanks.
Ive attached a printscreen images of my .c, .h, and the main.
Hi there, First post on the forum.
I would be very greatful if someone could explain why im getting an error message with the function prototypes, and how can i fix this? Thanks.
Ive attached a printscreen images of my .c, .h, and the main.
In the header file, the type Robot is unknown. It needs to be known (i.e. visible to the compiler) before it encounters the function declaration, in each compilation unit.
Since the functions are accepting pointers, you could get away with a forward declaration of Robot (aka "struct Robot;") in the header file. Alternatively, simply #include "robot.h"