0
typedef struct{
UINT8 startCharacter;
UINT16 frameCRCC;
UINT16 ageCount;
UINT8 senderID[3];
}INFO_FRAME;

when I use as below my code works fine

INFO_FRAME tx_frame={0x02,0x00,0x00,0x82,0x5E,0xE2};

when I use this definition:

typedef struct{
UINT8 startCharacter;
UINT16 frameCRCC;
UINT16 ageCount;
UINT8 senderID[3];
}INFO_FRAME tx_frame;

tx_frame={0x02,0x00,0x00,0x82,0x5E,0xE2};

I get this error:

Error: [Error(ccom)] parse error at near '{'  

I am using HEW to program a Renesas Microcontroller. This behaviour is quite strange.

nemo
  • 55,207
  • 13
  • 135
  • 135
CodeModeOn
  • 111
  • 1
  • 2
  • 11
  • Can you link me the entire code so i can compile it? – Manav Dubey Mar 22 '17 at 22:05
  • That dup is tagged C++ but the accepted answer applies to C as well. Basically, you have invalid syntax because the right hand side of the last line is an initializer and can only be used when the variable is declared (like in your first example). – kaylum Mar 22 '17 at 22:06

0 Answers0