请问有人能帮我理解C语言中关于结构体的错误吗?以下是我的代码:
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'};
我遇到了与O[13]、O[14]和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