I am trying to create unknown variable names (because the amount of variables I need to create will only be known during runtime). So I need to create then during runtime. I am using the below two lines of code to do so, but I am at a loss as to what I am missing:
String strRow = "row" + newCounter.ToString();
String[] strRow = new String[4];
The first line will create a String names e.g. "row0". I then want to use that name in the second line to create the new String Array unknown variable.
I am receiving the below two errors (which are obvious to me why, but I am at a loss as to how I can fix them:
Error 1 A local variable named 'strRow' is already defined in this scope
Error 2 Cannot implicitly convert type 'string[]' to 'string'
Any thoughts?
Thank you
Start Free Trial