I want to use an array of integers to define positions on a touch screen. As different images appear on the screen, I need to alter the array to reflect different touch positions. Now when I first define an array, I can use
int touchPos[10] = {1, 2, 3, ..., 10}
which is a nice succinct way to set the elements.
But then anywhere else in the program, I can't do this again, or the compiler accuses me of redeclaring a variable.
The only alternative I know of is to redefine the elements of the array one by one. So my question is, is there a way of quickly redefining a whole array like this with one line, or, failing that, can I "undefine" this array somehow, so that the initial declaration statement can be used more than once.