c - Why do I need more curly braces when initializing this structure? -


First of all I tried to start a structure like this:

  struct { Char age [2]; // Hold two 1-byte-age} Studio [] = {{23, 56}, {44, 26}};  

But it gives me a compiler warning about missing suspenders, so I used more breaks recommended by the compiler and ended up with:

 < Code> struct {four ages} [2]; // two 1-byte-age} studs keep [] = {{{{{23, 56}}, {{44, 26}}};  

No warning. Why do I need extra braces?

You have an array of strings, one member of the structure is an array.

  struct {four ages [2]; // hold two 1-byte age} Studio [] = {^ This is for Studio Array {{23, 56}}, ^ ^ | This is for age array which is for anonymous structure {{44, 26}}};  

It's easy to see if your strat is the second member:

  struct {int id; Four era [2]; } Study [] = {{1, {23, 56}}, ^ ^ id. | Age [0] | Age [1]};  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -