Get the latest tech news

C's designated initializers give us named arguments


In my previous post I talked about C++’s “relatively nerfed” form of designated initializers. This time I want to show you a neat thing you can do with C’s full-power designated initializers. I first saw this pattern in Ben Klemens’ book 21st Century C (2014), pages 226–228. (Godbolt.)

None

Get the Android app

Or read this on Hacker News

Read more on:

Photo of named arguments

named arguments