Hi all,
can any body tell me what is the error in the bellow code, i am getting the error that, you are not implemented the GetEnumerator in the IEnumerable
public class Stack : IEnumerable
{
T[] items;
int count=0;
public void Push(T data) { }
public void Pop() { }
public IEnumerator GetEnumerator()
{
for (int i = count - 1; i <= 0; i++)
{
yield return items[i];
}
}
}

Mangesh GRank #294 · 8.6K reputationPosted Dec 7, 2016, 9:03 PM EST