Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

yogesh_sahu

  • 3 years ago

can any body know design pattern in c++ ??

  • This Question is Closed
  1. goformit100
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    sir plz clear the question to me

  2. kevsturge
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    yep, what do you want to know about them

  3. thangeram
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    which design pattern

  4. yogesh_sahu
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    How to implement singleton design in C++?

  5. kevsturge
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    The synchronize C++ attribute implements support for synchronizing the target method of an object. Synchronization allows multiple objects to use a common resource (such as a method of a class) by controlling the access of the target method. public class Singleton { private static Singleton instance = null; private Singleton() { } public static synchronized Singleton getInstance() { if (instance == null) { instance = new Singleton(); } return instance; } }

  6. yogesh_sahu
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    thanks kevsturge for replay this is helpfull for me

  7. kevsturge
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    ok, if you have any trouble implementing it let me know

  8. oldrin.bataku
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Disregard kevsturge's response as he targets Java, not C++, as evident by both his mentioning of a synchronized keyword and the code he posted. A C++ singleton pattern implementation can be found here: http://stackoverflow.com/a/1008289/591495 Note, however, that in most contexts, the singleton is actually viewed as an anti-pattern. Be careful in how you apply it.

  9. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy