Wednesday, June 29, 2011

Singleton Pattern & its implementation with C++

#include
#include "Singleton.h"
using namespace std;

void useSingleton(){
Singleton* singletoneg= Singleton::getInstance();
singleton->doSummut();

// this shouldn't be allowed
Singleton* doubleton;
doubleton->doSummutElse();
}

int main(int argc, char** argv) {
useSingleton();
return (EXIT_SUCCESS);
}

No comments:

Post a Comment

Thank you for Commenting Will reply soon ......

Featured Posts

Permission Denied while deleteing a file or folder in Windows

“ Access denied ” while deleting a directory usually means the folder is in use, protected, owned by another user, or you lack sufficient pe...