how to overcome this array errror

Posted by Oswaldlily under C# on 12/13/2011 | Points: 10 | Views : 608 | Status : [Member] | Replies : 2
List[0].a=200
list[1].a=100
list[2].a=300
if((list (i).a<list[i+1].a) && (list (i).a<list[i+2].a))
{
//when "i" is 1 it gives me error.since list[3] not here in option.so hw to overcome

}




Responses

Posted by: Hmanjarawala on: 12/13/2011 [Member] Bronze | Points: 25

Up
0
Down
List[0].a=200
list[1].a=100
list[2].a=300
if((list[i].a<list[i+1].a) && ((i<list.Length-1) && (list[i].a<list[i+2].a)) )
{
//when "i" is 1 it gives me error.since list[3] not here in option.so hw to overcome

}

Himanshu Manjarawala
Sr. Software Engineer@AutomationAnywhere
http://fieredotnet.wordpress.com/

Oswaldlily, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Oswaldlily on: 12/13/2011 [Member] Starter | Points: 25

Up
0
Down
@Hmanjarawala

facing same error still

Oswaldlily, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response