P
Pawel_Iks
Let's consider following class:
class A {
int sth;
public:
A(int s): sth(s) {}
A() {}
~A() {}
}
and when I'd like to create an array with 100 elements of A type I
write:
A* tab=new A[100]
but I'm interested if it is possible to use constructor A(int) instead
of A() with new operator, and if not why?
class A {
int sth;
public:
A(int s): sth(s) {}
A() {}
~A() {}
}
and when I'd like to create an array with 100 elements of A type I
write:
A* tab=new A[100]
but I'm interested if it is possible to use constructor A(int) instead
of A() with new operator, and if not why?