Saturday, May 15, 2010 [Tweets] [Favorites]

Fun With C99 Syntax

Dave Dribin:

But because these are anonymous variables, you can take the address of them:

int * iPointer = &(int) {3};

This can be useful for some Core Audio APIs, such as AudioUnitSetProperty. Typically you create a variable for the sole purpose of taking the address of it…

1 Comment

Cute trick - but I've always been annoyed that the AudioUnit APIs encourage such byzantine constructs!

Stay up-to-date by subscribing to the Comments RSS Feed for this post.

Leave a Comment