I am trying to understand why my conditional if statement is giving me a compile error.
Is this not correct?
for(int i=startAt; i>=_itemsList.Count; length < 0 ? i-- : i++;)
{
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
According to the MSDN it should be one of what the error message says:
assignment statement
invocation of a method
prefix or postfix increment expression, such as ++i or i++
prefix or postfix decrement expression, such as –i or i–
creation of an object by using new
await expression
One of the weird compilable solutions would be: