2
How can I store values and variables of all types within a vector? Ex:
vetor1.Add("valor em string");
vetor1.Add(100);
vetor1.Add(100.10);
vetor1.Add(-100);
I have no idea how I can do this.
2
How can I store values and variables of all types within a vector? Ex:
vetor1.Add("valor em string");
vetor1.Add(100);
vetor1.Add(100.10);
vetor1.Add(-100);
I have no idea how I can do this.
5
That doesn’t sound like a array rather a list. The general type for all types is the object
, then just use it.
var vetor = new List<object>() { "string", 100, 100.10, -100 };
Browser other questions tagged c# .net list objects
You are not signed in. Login or sign up in order to post.
Are you sure this is what you want? Recovering this data after can be laborious
– Jefferson Quesado
Yes, according to the answer below Maniero, I found that to recover the data from
object
just give onecast
.– sYsTeM