J
Jeff.Boeker
I'm learning a lesson in how I need to be more specific
In C++ I can resize a vector and it will allocate memory and it will
call the default constructor if necessary (or I can supply an instance
for the copy constructor).
For example:
C++
vector<class> vClass;
vClass.resize(1000);
vClass[37].Property = 4;
C#
List<class> lstClass;
lstClass = new List<class>(1000);
for (int instance = 0; instance != 1000; ++instance)
vClass.Add(new class());
vClass[37].Property = 4;
I'm hoping there is a better way then my loop.
Jeff
In C++ I can resize a vector and it will allocate memory and it will
call the default constructor if necessary (or I can supply an instance
for the copy constructor).
For example:
C++
vector<class> vClass;
vClass.resize(1000);
vClass[37].Property = 4;
C#
List<class> lstClass;
lstClass = new List<class>(1000);
for (int instance = 0; instance != 1000; ++instance)
vClass.Add(new class());
vClass[37].Property = 4;
I'm hoping there is a better way then my loop.
Jeff