Sure, take a look in the RobotCIntrinsics.c header file and you will see the numeric values for the various sensor types (the cortex is defined as VEX2). You may need to cast to tSensors to stop any warnings. I can post an example later of you get stuck.
This is actually really cool. I have thought of things before that would be so much easier with iterating through sensors with loops, but I just did not know how to to it.
Is there a way to iterate through motors like this?