array of objects of a class
- by anurag18294
#include
class test{
int a;
char b;
public:
test()
{
cout<<"\n\nDefault constructor being called";
}
test(int i,char j)
{
a=i;
b=j;
cout<<"\n\nConstructor with arguments called";
}
};
int main()
{
test tarray[5];
test newobj(31,'z');
};
In the above code snippet can we intialize values to tarray[5].