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.
This is a discussion on Help with Error message within the C Programming forums, part of the General Programming Boards category; Hi there, First post on the forum. I would be very greatful if someone could explain why im getting an ...
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"
Right 98% of the time, and don't care about the other 3%.