Reputation: 7645
How is the construct (int) { 1 }
called in C? A guess was "anonymous constant", but this didn't show any helpful on Google. As a sidenote, you can use this construct to tell ioctl that you want to use a variable with the value of 1: ioctl (..., &(int) { 1 })
.
Upvotes: 13
Views: 210
Reputation: 363787
It's called a "compound literal" and constructs a temporary int
-typed lvalue.
Upvotes: 13