2015-10-16 02:05 PM
Guys,
I tried to use unsigned char below, but I got error, how can I fix it ? [CODE]const unsigned char data[] = {0xFF,0xF2,0x40,0xC0,0x19,0xB7,0x00,0x14,0x02,0xE6,0x5C,}; unsigned char *q; q = data ; [/CODE] [CODE]..\Src\main.c(274): error: #513: a value of type ''const unsigned char *'' cannot be assigned to an entity of type ''unsigned char *'' q = data;[/CODE] Thanks2015-10-16 04:41 PM
Well you could make the pointer a const one, or lose the const directive on the data.
You could also explicitly cast it.const means the content is unchangeable and can be placed in ROM/FLASH, the compiler is trying to enforce rules so you don't try to write to the data structure.