Saturday, March 6, 2010

Constructors

The following two lines are functionally equivalent:
std::string * pName = new std::string();
std::string * pName = new std::string;

Reference: "C++ Gotchas" by Stephen C. Dewhurst, Addison-Wesley, 2002., p. 51.

No comments:

Post a Comment