在'='之前预期':',',',';','}'或'__attribute__'

时间:2016-01-09 22:11:10

标签: c struct compiler-errors avr atmelstudio

编程Atmega328时我没什么问题

这段代码给出错误:

UPDATE mytable SET `randomStates`= randomly selected state value WHERE randomStates IS NULL
Atmel Studio 7中的

expected ':', ',', ';', '}' or '__attribute__' before '=' token

整个代码here

1 个答案:

答案 0 :(得分:1)

您无法使用该语法初始化struct的成员。您可以使用:

struct
{
   const uint8_t fioletowy[3];
   const uint8_t blekitny[3];
   ...
} kolory = 
{
   {255,0,255},
   {0,255,255},
   ...
};