array of objects of a class

Posted by anurag18294 on Stack Overflow See other posts from Stack Overflow or by anurag18294
Published on 2010-05-31T06:20:39Z Indexed on 2010/05/31 6:22 UTC
Read the original article Hit count: 124

Filed under:

#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].

© Stack Overflow or respective owner

Related posts about c++