Using loops to generate arrays

Just a quick question - Im trying to form an algorithm that uses a loop to initialise individual, unrelated arrays. So for example (I know this probably isnt correct but it's the jist of it) -

1
2
3
4
for (int val=1;val<a;val++)
{
int S(val)[x];  //x being the number of elements per array, S(val) being the arrays 'definition' e.g. S(1), S(2) etc
}


Can I do this, or would I have to initialise them individually? Cheers
I don't understand how the code snippet you gave is reflective of the problem statement, but I also don't fully understand the problem statement either. Can you be more specific?
I think I understand, and you cannot allocate arrays in this manner; besides the fact that cannot use parentheses in a symbol name, variable names are not replaced in symbol names.
I was just trying to form multiple arrays from one single statement, as the number needed is a variable ('a'), and these are then used in carrying out further calculations. So the only way to do this would be to initialise them at first and individually?

I was thinking of forming a 2D-array with 'a' rows, 'x' columns and nested loops to carry out the calculations but the resources ive found online for this are very elementary. any suggestions to what may possibly help? thanks
You can create a 2D array using loops, read this article: http://www.cplusplus.com/forum/articles/7459/
ah quality, sorted! cheers for the link bazzy :)
Topic archived. No new replies allowed.