Answer the question
In order to leave comments, you need to log in
How does assignment work in C#?
Good day. Have a question, how does assignment work in C#?
There is some code:
for (int i = 1; i < where; i++)
{
dstr = checkmanyroads(i);
i = dstr;
}
Answer the question
In order to leave comments, you need to log in
It would be better not to use the for loop for other purposes, changing the i parameter in the loop body is actually an antipattern. Loops like yours should be written like this:
int i = 1;
while (i < where)
i = checkmanyroads(i);
The question is, what does the checkmanyroads(i) function return and why is its value assigned to the iteration variable i ?
According to the code, it turns out that i , overwritten by the value from the function, is infinitely less than where
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question