+ 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!
7 Answers
+ 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 âșïž
+ 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.đč
+ 1
Can you show it in code ?
Why are you not using a " list"
What type are the elements in the array.
+ 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
0
I know of fixed size arrays and list where you just can add items ?
What do you mean by dynamic array ?
0
I mean when number of elements are increasing and the array does not have enough size to store data we resize the array.
0
dynamic size array or an array of dynamic types?