MultiTexturing an unknown amount of textures

I am writing an advanced MD3 engine. MD3’s in them have textures for each mesh. The thing is there could be from 0 to 32 textures. Is there a way I could write a for loop that will go threw all the textures and bind each of them to the object without a huge switch statement?