Hey everyone! Could someone please help me understand this error in C for structures? This is my code:
struct Orientation
{
char facing;
char sensor;
char mazeDir;
};
struct Orientation O[16];
O[0] = {'N', 'F', 'N'};
O[1] = {'N', 'B', 'S'};
O[2] = {'N', 'R', 'E'};
O[3] = {'N', 'L', 'W'};
O[4] = {'S', 'F', 'S'};
O[5] = {'S', 'B', 'N'};
O[6] = {'S', 'R', 'W'};
O[7] = {'S', 'L', 'E'};
O[8] = {'E', 'F', 'E'};
O[9] = {'E', 'B', 'W'};
O[10] = {'E', 'R', 'S'};
O[11] = {'E', 'L', 'N'};
O[12] = {'W', 'F', 'W'};
O[13] = {'W', 'B', 'E'};
O[14] = {'W', 'R', 'N'};
O[15] = {'W', 'L', 'S'};
and I get these errors regarding O[13], O[14] and O[15]
..\RMNCODE.C(282): error C231: 'O': redefinition
..\RMNCODE.C(283): error C279: 'O': multiple initialization
..\RMNCODE.C(283): error C231: 'O': redefinition
..\RMNCODE.C(284): error C279: 'O': multiple initialization
..\RMNCODE.C(284): error C231: 'O': redefinition