Hello,
I have a question about arrays.
Is it possible for the array's values to be variables?
For instance:
int a, b, c, d, e;
a = 1;
b = 2;
c = 3;
d = 4;
e = 5;
int myInts[5] = {a, b, c, d, e};
Is this a valid way to declare the array's values?
If so, is it possible to afterwards change those values, or will it be considered redefining (of "myInts" in my example).
//some function changes variables a, b, c, d and e value
a = 55;
b = 60;
c = 65;
d = 70;
e = 75;
int myInts[5] = {a, b, c, d, e}; //is this a redefinition?
If it is not a valid way to declare those values, any suggestions on how is it doable? should I use something different than Arrays, or are there some details that have to be added?
(two dimensional arrays wouldn't accomplish the task because I need the array's values to change very often; basically, every few milliseconds or so, because it will be storing data from an input and working with it right away. When done working, it will need to use new data -- it's a real-time program)
Thank you very much,
Mike
P.S. if there's something I didn't explain well, ask me to clarify it and I will do so without problem.