+ 2
Is it possible to make an array of infinite size?
7 ответов
+ 4
Theoretically speaking, of course not. In order to do that you would have to be able to somehow define infinite, and somehow fit it in to your memory.
But it's possible to have an array which will adapt to the size it's suppose to hold, by dynamically increasing it when it's prompted of a new allocation.
+ 3
You are not able to do it with the Array object in C#, but you can resort to its close cousin, List. I wrote you a small example of its syntax and how to generally implement it. Although, you can refer to Microsofts documents on it. https://msdn.microsoft.com/en-us/library/6sh2ey19(v=vs.110).aspx
https://code.sololearn.com/c2Tn7EDs9PQK/#cs
+ 3
thanx cubi*
+ 3
can we do similar program in c++
+ 3
Sure, in C++ we're going to be using the Vector object instead. I once again wrote you an example of its syntax and implementation, and I kept the same idea as with the C# example. I'll refer you to cplusplus.com site also, for future reference. http://www.cplusplus.com/reference/vector/vector/
https://code.sololearn.com/cIz3Gcap6Yyl/#cpp
+ 3
thanks again
+ 2
how can I do that plz help me