Type definitions within conditionals?
Is this possible?
void definer(int bitrate)
if (bitrate = 8) typedef char MY_TYPE;
if (bitrate = 32) typedef signed long MY_TYPE;}
Then, MY_TYPE would be used in the main() function.
I'm making an audio app using the RtAudio classes, which has numerous functions that require the size of each piece of audio data. At compile time, I could use #ifdef BITRATE_8 #define ... #endif, but I need this to be at runtime. Even within the definer function, if I try to use MY_TYPE later, GCC gives an error saying MY_TYPE is not defined in the scope. Any ideas?