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

Initializing a struct

Hi,
I am trying to initialize a struct, but I get the following error:

Error #29: Expected an expression

typedef struct
  {
    atp V1;
    atp V2;
    atp V3;
    atp V4;
   } tosh_at;


tosh_at tosh_options
={
  .V1 = 12,
  .V3 = 5,
 };

Can someone please help me. Thanks in advance.

Parents
  • It is always important to have a running knowledge about the C language standard, since not all (especially embedded) compilers complies with the most recent standard. It's just a too small market to invest all the time for larger compiler rewrites.

    That is also one of the reasons why many embedded compilers defaults to older language standards even when a newer standard is supported.

Reply
  • It is always important to have a running knowledge about the C language standard, since not all (especially embedded) compilers complies with the most recent standard. It's just a too small market to invest all the time for larger compiler rewrites.

    That is also one of the reasons why many embedded compilers defaults to older language standards even when a newer standard is supported.

Children