C# - can you name a matrix with the contents of a string

Posted by RHodgett on Stack Overflow See other posts from Stack Overflow or by RHodgett
Published on 2010-06-08T14:23:05Z Indexed on 2010/06/08 14:32 UTC
Read the original article Hit count: 119

Filed under:
|
|

Basically I have x amount of matrices I need to establish of y by y size. I was hoping to name the matrices: matrixnumber1 matrixnumber2..matrixnumbern

I cannot use an array as its matrices I have to form.

Is it possible to use a string to name a string (or a matrix in this case)?

Thank you in advance for any help on this!

for (int i = 1; i <= numberofmatricesrequired; i++)
        {
        string number = Convert.ToString(i);
        Matrix (matrixnumber+number) = new Matrix(matrixsize, matrixsize);
        }

© Stack Overflow or respective owner

Related posts about c#

Related posts about arrays