Hi there, I was wondering if there is a more efficient way of doing the following without having to re-include parts of the code?
Code:
if (num_channels==1){*out1++=0;}
else if (num_channels==2){*out1++=0; *out2++=0;}
else if (num_channels==3){*out1++=0; *out2++=0; *out3++=0;}
else {*out1++=0; *out2++=0; *out3++=0; *out4++=0;}
This is a simple example but in my code there is a lot of work to be done for each channel which would make the program much smaller if I didn't have to re-include the code each time. Also my program might be extended to 32 channels which would leave lots of extra code lying around in these if statements.
I had a look at using switch statements but this didn't compile as I have some declarations which could potentially be skipped.
Thanks