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.
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.
This does not look like an array but a list. The general type for all types is object
, so just use it.
var vetor = new List<object>() { "string", 100, 100.10, -100 };