M
mati-006
Hi
Short question for which I can't find answer:
I want to initialize the array of objects with the same values.
new MyType[n]; calls default constructor
new MyType(val1, val2); initializes only one element
Is there any way to merge these two things?
Now I have something like this:
p = new MyType[n];
for(int i=0;i<n;i++) p.init(val1,val2);
And this is ugly to me...
Short question for which I can't find answer:
I want to initialize the array of objects with the same values.
new MyType[n]; calls default constructor
new MyType(val1, val2); initializes only one element
Is there any way to merge these two things?
Now I have something like this:
p = new MyType[n];
for(int i=0;i<n;i++) p.init(val1,val2);
And this is ugly to me...