Copy-assignment operatorI'm using pointer string because of exercise in book c++ primer. Otherwise I would use smart pointer...
Copy-assignment operatorSo better way would be just to copy like this: [code] HasPtr &HasPtr::operator=(const HasPtr& obj){ ...
Copy-assignment operatorthis code [code] HasPtr &HasPtr::operator=(const HasPtr& obj){ ps = new string(*obj.ps); i =...
Is c++ primer really for beginners?The first chaper in C++ primer is bit confusing, but if you don't understand it just move to PART 1 ...
Dynamic memoryWell I know that I musn't use first code ever because it could crash program, it was just an example...