There's gotta be a moderately automated way to do this.
One way I can think of to make the array-resizing a bit easier would be to do something like this:
Code:
enum ReadReasons (CAMERA_X,CAMERA_Y,CAMERA_Z,CAMERA_SPEED,TURN_SPEED,REASON_COUNT);
bool myArray[REASON_COUNT];
int main()
{
Read(CAMERA_X);
Read(CAMERA_Y); // the read function would perform behavior appropriate to whatever was passed in
Read(CAMERA_Z);
}
void Read(ReadReason blah)
{
switch(blah)
{
case CAMERA_X:
if(myArray[CAMERA_X])
Terminal_Print("Enter camera pan mode: ");
Terminal_Read();
}
}
Now, so long as the programmer defines a new entry in that enum each time they make a new call to Read, the array will be resized appropriately at compile time. IMO, it slightly improves code readability because you have a reason for each read that MUST be defined in clear english.
I keep thinking you could also use the preprocessor to do this, because having to do dynamic allocation for something that you know the needed size of at compile-time just sets of alarm bells in my head.