Loop until ESC and then redim array..

Hey all :)

In my console app, a simple beep sequencer, I have set up a loop to allow 10 notes to be entered with octave and duration settings for each which works fine but what ideally i'd like is allow an unlimited amount of notes to be entered until the user hits ESC or something to end it..

Then of course I need to re-dimension the arrays to suit the amount of notes entered..

I saw some similar code to below. Is this the best / easiest method to keep the note entry going until they press ESC?

Also, how do I re-dim an array? I know how to do it in VB but not C++


1
2
3
4
5
6
7
8
9
10
	// WHILE: KEEPING GETTING INFORMATION ENTRY UNTIL USER PRESSES ESC..
	while (1)
	{
		if (GetAsyncKeyState(VK_ESCAPE))
		{
			// CODE FOR ENTERING DETAILS..
			break;
		}
	// CODE TO RE-DIMENSION THE ARRAY..
	} // END WHILE.. 


Thanks,

Paul..
Actually, I think I'd need to move the re-dim code to outside the while loop. Is that right?
Topic archived. No new replies allowed.