c# - Set string[] values with a loop -


i'm looking setting values of array in c# way :

        int = 0;         string[] faces = new string[104];          (i = 1; < 104; = i++)         {             faces[i] = i.tostring();         } 

however think code missing something, don't have error visual studio, it's looping without end. help

change this:

i = i++ 

to this:

i++ 

i++ evaluated before increment, you're setting i i.

@jmcilhinney correct want start @ 0, not 1.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -