C
C#2y ago
Cake

✅ How do I fix the CS0201 error this code?

I'm basically trying to number my items(that is produce via textbox.text > in ListView
int PlayerVal = int.Parse(AnswerBox.Text);
int[] Playeranswers = { PlayerVal };
var TotalQ = Playeranswers;
int[] Questions = { a, b };
for (int i = 0; i == i + 1; i < Playeranswers.Length)
{
ResultListView.Items.Add(i.ToString());
}
ResultListView.Items.Add(PlayerVal.ToString());
int PlayerVal = int.Parse(AnswerBox.Text);
int[] Playeranswers = { PlayerVal };
var TotalQ = Playeranswers;
int[] Questions = { a, b };
for (int i = 0; i == i + 1; i < Playeranswers.Length)
{
ResultListView.Items.Add(i.ToString());
}
ResultListView.Items.Add(PlayerVal.ToString());
2 Replies
Angius
Angius2y ago
Did you confuse the structure of a for loop? for (initial state; run condition; state change) for (int i = 0; i < stuff.Length; i = i + 1) for example
Cake
CakeOP2y ago
AH so that's what I did wrong. Yeah I did Thanks alot thumbsupsmiley

Did you find this page helpful?