forum

Home / DeveloperSection / Forums / generic list class in c#

generic list class in c#

Royce Roy 2216 25-Jan-2014

I'm currently making my own very basic generic list class (to get a better understanding on how the predefined ones work). Only problem I have is that I can't reach the elements inside the array as you normally do in say using "System.Collections.Generic.List".

GenericList<type> list = new GenericList<type>();

list.Add(whatever);

This works fine, but when trying to access "whatever" I want to be able to write :

list[0];

But that obviously doesn't work since I'm clearly missing something in the code, what is it I need to add to my otherwise fully working generic class ?


c# c# 
Updated on 25-Jan-2014

Can you answer this question?


Answer

1 Answers

Liked By