when I use the codes in VS2017,I failed. And these codes are from C++ Prime Plus 8.2.4-3
const free_throws & clone (free_throws & ft)
{
free_throws * pt; // sequence 1
*pt = ft; // sequence 2
return *pt;
}
free_throws is a struct
struct {
std::string name;
int made;
int attempts;
float percent;
}
In this book,he said there is a new() function without name that was used;
my question is: where the new() used?
sequence 1 or sequence 2 or it's a wrong code.