This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

variable lenght of array not accept by keil uvision4


typedef struct
{
int len;
char api_identifier;
long DH;
long DL;
int source_addr_16bit;
char options;
char frame_id;
char AT_com[2];
char status;
int data_len=10;        // stores the length of the data
char data[20];  // also stores the "value" for at command response
char checksum;

} RxPacket;

.
.
.
.
.
.
char buff[ RxPacket.data_len];

consider the above code written in c for ARM 7 in keil uvision4
I'd taken structure of few data, when i'm trying to access data_len by it's pointer through array then IDE shows error.....

main.c(402): error: #60: this operator is not allowed in an integral constant expression char buff[RxPacket.data_len];

any idea how do i solve this error