What's the proper format for a union initializer list?
问题 Say I have a class/struct with a single union in it... something like: struct Box { union { AS128 intr; struct { AS32 a, b, c, d; }; }; }; What's the proper way to do an initializer list for this kind of data type? Box iMyBoxA = { 10, 10, 100, 100 }; Box iMyBoxB = ( Box ){ 10, 10, 100, 100 }; The 'A' option above works in many cases, but isn't completely portable... giving the error "no known conversion for argument 1 from 'brace-enclosed initializer list'". And the second doesn't compile