cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
limit number of object that can be creat
limit number of object that can be created
Aug 31, 2014 at 6:25am UTC
dharmesh tyagi
(1)
i want to limit the number of objects that can be created for a class....
like for a
class Student
i want only two object can be created. as soon as user try to create another object it should flash a error message. and object should not be created.
would be thankful if any one could help out
Aug 31, 2014 at 6:33am UTC
LB
(13399)
You could use a static factory pattern. But why would you want this absurd feature? There is most likely a better way to do what you are trying to do.
Last edited on
Aug 31, 2014 at 6:33am UTC
Topic archived. No new replies allowed.