class function that generates its own objects

Posted by honeybadger on Stack Overflow See other posts from Stack Overflow or by honeybadger
Published on 2011-01-10T05:32:28Z Indexed on 2011/01/10 5:53 UTC
Read the original article Hit count: 146

Filed under:

I want to write a class for some use. I want to call a function (say generate) of this class which will generate two objects of this same class. These two objects will call other function of the class. Can anyone tell me how to do this? I want it in C++

Class Example{ public: generate(); other_func();

}

int main() { Example generate(); }

Now this generate function should create two object of Example and will call other_func();

© Stack Overflow or respective owner

Related posts about c++