Hello All,
I am working through the example problem at Prime Pattern | CodeChef. (As a side note: This is a very good site for anyone that wants to practice their programming skills.) I have made a structure and pointer to it. I am getting a compiler error that I don't understand. Here is my structure and pointer:
Code:
typedef struct
{
int8_t x_coor;
int8_t y_coor;
uint8_t square_count;
uint8_t move_count;
} movement;
typedef movement *pt_to_movement;
Here is where I defined one of each and tried to assign the address of the structure to the pointer.
Code:
void moving_init(void)
{
movement mover;
pt_to_movement pt_to_mover;
pt_to_mover &mover;
mover.x_coor = 0;
mover.y_coor = 0;
mover.square_count = 0;
mover.move_count = 0;
}
The error says: invalid operands to binary & (have 'pt_to_movement' and 'movement'). It is pointing to the line: pt_to_mover &mover;
I'm sure I'm missing something simple. Anyone see the problem?
Thanks