Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 2
    just use string to store the message. Or is there a reason for the char *? Commented Jul 3, 2013 at 2:48
  • No, there is no reason for char*. I changed the code to string. Thanks. Commented Jul 3, 2013 at 3:07
  • Or just wite a destructor that deletes the allocated character array. Commented Jul 3, 2013 at 3:25
  • related stackoverflow.com/questions/2715386/… Commented Feb 19, 2017 at 22:36
  • std::exception already guarantees the storage of a custom message. Why not re-use. Even if derive from std::exception you can still use that functionality. Commented Sep 26, 2020 at 19:49