hi,
I am pretty new to C#, but have some experience with other lang.(delphi,ph p,asp...). I wanted to create dynamic array of structs type, but it wont work. So I google it, and found that C#.NET CAN NOT work with dynamic arrays... (pretty weird)
So I want to please more experienced C# programmers to help me with my elementary problem, which grows into nightmare :-)
All I want is simple data structure:
1. Structs type called Bar
string a,b,c;
2. Array of Bar(s) called Bars
I want it to be accessible through:
Bars[i].a
Bars[i].b
Bars[i].c
when I create it using ArrayList, than it complaints about dimensions etc. and I can not figure how I can access these values, because when I use Bars.Add() it creates member of Bars but type OBJECT ?? I do not want type object, I simply want to create a set of structs records with not knowing how much of them I will have...
Thanks very much for your help and tips how to solve this little problem !! I am looking forward to hearing from you. Have a nice day!!
I am pretty new to C#, but have some experience with other lang.(delphi,ph p,asp...). I wanted to create dynamic array of structs type, but it wont work. So I google it, and found that C#.NET CAN NOT work with dynamic arrays... (pretty weird)
So I want to please more experienced C# programmers to help me with my elementary problem, which grows into nightmare :-)
All I want is simple data structure:
1. Structs type called Bar
string a,b,c;
2. Array of Bar(s) called Bars
I want it to be accessible through:
Bars[i].a
Bars[i].b
Bars[i].c
when I create it using ArrayList, than it complaints about dimensions etc. and I can not figure how I can access these values, because when I use Bars.Add() it creates member of Bars but type OBJECT ?? I do not want type object, I simply want to create a set of structs records with not knowing how much of them I will have...
Thanks very much for your help and tips how to solve this little problem !! I am looking forward to hearing from you. Have a nice day!!
Comment