1.

Can User-defined Object Be Declared As Static Data Member Of Another Class?

Answer»

Answer :Yes. The following code shows how to initialize a user-defined object. #include class test { int i ; PUBLIC : test ( int ii = 0 ) { i = ii ; } } ; class SAMPLE { static test s ; } ; test sample::s ( 26 ) ; Here we have INITIALIZED the object s by calling the one-argument constructor. We can use the same convention to initialize the object by calling multiple-argument constructor.



Discussion

No Comment Found