i written code using for loop in 2 ways like below
first way
for(int i=0;i<myList.Items.Count;i++)
{
.....
.....
.....
}
second way
int itemsCount = myList.Items.Count;
for(int i=0;i<itemsCount;i++)
{
.....
.....
.....
}
in my view first way is better even though each and every incremnt of i value its checking (i< myList.Items.Count) because at runtime it simply replace myList.Items.Count with memeroy refrence so according to mine if i taken a new local variable to assign count of items its just a wastage of memory.
i want to know how it acts when i written code like above and tel me which way is more better in the view of performance aspect