C Programming Help

timer Asked: Jan 21st, 2015

Question description

1.In the main function instantiate two Student objects using shared pointers. Declare two new Student shared pointers and assign them to each of the two previously instantiated objects. Next instantiate two more Student objects using weak pointers. Assign each of the weak pointers to one of the shared pointer Student objects. Display the usage count of each pointer to the display. 2.Within an if statement check to make sure that one of the weak pointers is valid. If it is valid declare a new Student share pointer within the body of the if statement and assign it to the weak pointer that was checked. Display the usage count of the shared pointer. 3.After the body of the if statement, display the usage count of the shared pointers once again. Reset one of the share pointers and then display the usage count of that pointer. 4.Create a new Student object using a unique pointer. Declare another Student object as a unique object. Using move semantics, move the first unique object to the second unique object. 5.Note what is displayed on the screen and the destructor statements.

Tutor Answer

(Top Tutor) Studypool Tutor
School: UIUC
Studypool has helped 1,244,100 students
flag Report DMCA
Similar Questions
Hot Questions
Related Tags

Brown University

1271 Tutors

California Institute of Technology

2131 Tutors

Carnegie Mellon University

982 Tutors

Columbia University

1256 Tutors

Dartmouth University

2113 Tutors

Emory University

2279 Tutors

Harvard University

599 Tutors

Massachusetts Institute of Technology

2319 Tutors

New York University

1645 Tutors

Notre Dam University

1911 Tutors

Oklahoma University

2122 Tutors

Pennsylvania State University

932 Tutors

Princeton University

1211 Tutors

Stanford University

983 Tutors

University of California

1282 Tutors

Oxford University

123 Tutors

Yale University

2325 Tutors