June 2017
Intermediate to advanced
532 pages
12h 59m
English
We are going to define a structure that is composed of multiple members. Then, we allocate an instance of this structure on the heap that is maintained by a shared pointer. From this shared pointer, we obtain more shared pointers that do not point to the actual object but to its members:
#include <iostream> #include <memory> #include <string> using namespace std;
struct person { string name; ...Read now
Unlock full access