Skip to content

Commit

Permalink
Merge pull request huangmingchuan#7 from sanerror/master
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
huangmingchuan authored Nov 11, 2016
2 parents f02b386 + b02e05d commit 0b03faa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ch13/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Sales_data::Sales_data(Sales_data rhs);
Point global;
Point foo_bar(Point arg) // 1
{
Point local = arg, *heap = new Point(global); // 2, 3
*heap = local;
Point local = arg, *heap = new Point(global); // 2: local = arg
*heap = local; // 3: *heap = local
Point pa[4] = { local, *heap }; //4, 5
return *heap; //6
}
Expand Down
4 changes: 2 additions & 2 deletions ch13/exercise13_5.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ class HasPtr
{
public:
HasPtr(const std::string &s = std::string()) : ps(new std::string(s)), i(0) {}
HasPtr(const HasPtr& hp) :ps(new std::string(hp.ps)), i(hp.i) {}
HasPtr(const HasPtr& hp) :ps(new std::string(*hp.ps)), i(hp.i) {}
private:
std::string *ps;
int i;
};


#endif
#endif

0 comments on commit 0b03faa

Please sign in to comment.