Designated Initialization With Compound Literals in C
O'Reilly Software
JULY 24, 2013
Just a quick post on something I just discovered and found neat (I always find obscure C syntax interesting). I was trying to figure out how to use a C designated initializer, where a member was a pointer to another designated initializer. At this point, you need a compound literal. Just a quick background on C initialization: // verbosely create an array with a known size int arr [3]; arr[0] = 1; arr[1] = 2; arr[2] = 3; // => [1, 2, 3] // concisely create an array with a known size int arr [
Let's personalize your content