Jony
Jony

Reputation: 6774

object oriented programming in c++

how do i make only 1 object creation of any class?

Upvotes: 0

Views: 229

Answers (2)

mcabral
mcabral

Reputation: 3558

Check out the Singleton Pattern: http://sourcemaking.com/design_patterns/singleton

EDIT: Updated link from C# to C++

Upvotes: 1

Alex Martelli
Alex Martelli

Reputation: 882591

It's known as the Singleton design pattern. There are many tutorials for it, e.g. one here.

Upvotes: 1

Related Questions