Saturday, May 15, 2010

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 RSS · Twitter


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

Leave a Comment