How to create variable name with integer appended to the end?
I want to create a for loop that will fill a bunch of arrays with data in
c++. Now to save space and in the future once more arrays are added which
they will, I have the for loop. Each array for demonstration purposes is
called Array# (# being a number) The point of the for loop would be to set
a constant with maximum arrays, then cycle through each array filling by
appending i to the end of the Array name.
For example in pseudo code:
for (i = 1; i < numberofarrays; i++)
{ fill (Array & i) with ("Array" & i & "-default.txt")}
No comments:
Post a Comment