+ 1

How can I make a dynaimc array as a field in a class? #C#

I want to code efficiently and I wanna make a dynamic array in a class as a field!

18th May 2018, 7:54 PM
Alireza Askarikheirabadi
Alireza Askarikheirabadi - avatar
7 Respuestas
+ 1
Hello! There's docs about lists with explanation and examples https://msdn.microsoft.com/en-us/library/6sh2ey19(v=vs.110).aspx Happy Coding ☺️
19th May 2018, 1:32 PM
dev.Y
dev.Y - avatar
+ 2
thank you very much. I did not know about lists but now by your kindness helps I'm figuring out how can I use lists in my programs.🌹
20th May 2018, 9:39 PM
Alireza Askarikheirabadi
Alireza Askarikheirabadi - avatar
+ 1
Can you show it in code ? Why are you not using a " list" What type are the elements in the array.
18th May 2018, 9:32 PM
sneeze
sneeze - avatar
+ 1
I made some code as example, with a list as field in a class. A list is dynamic, you always can add or remove items from the list. https://code.sololearn.com/cUbJPM9XHvN6
19th May 2018, 9:09 PM
sneeze
sneeze - avatar
0
I know of fixed size arrays and list where you just can add items ? What do you mean by dynamic array ?
18th May 2018, 9:01 PM
sneeze
sneeze - avatar
0
I mean when number of elements are increasing and the array does not have enough size to store data we resize the array.
18th May 2018, 9:30 PM
Alireza Askarikheirabadi
Alireza Askarikheirabadi - avatar
0
dynamic size array or an array of dynamic types?
19th May 2018, 8:28 AM
hinanawi
hinanawi - avatar