We can initialize an array for a structure which has a default constructor, but can we do that with a parametrized constructor?
struct class{
int room;
int floor;
class(){
room=0;
floor=0;
}
};
int main(){
class c1[5];
}
Above code works fine. But, what to do when there is a parameterized constructor?
struct class{
int room;
int floor;
class(int r,int f){
room=r;
floor=f;
}
};