Well, if your question is about complex literal syntax, then the important detail here is that you are not initializing the array inside the structure. You initialize the pointer inside the structure. The code you have is formally correct.
If you really have an array inside your structure, then such initialization with a composite literal will not work. You cannot initialize an array from another array. Arrays cannot be copied (except for initializing the char array from a string literal). However, in this case, you can use a regular {} -included initializer, rather than a compound literal.
Also keep in mind that the lifetime of a composite literal (unsigned[]) { 1u, 2u, 3u, 4u, 5u, } is determined by the scope in which it appears. If you do this in the local scope, the array of massive literals will be destroyed at the end of the block. The pointer value (if you somehow delete it outside of this block) will become invalid.
source share