Question PRG-CPP-0015
HardWhat is the output of this program?
#include <iostream>
#include <memory>
using namespace std;
int main() {
auto p = make_shared<int>(5);
auto q = p;
cout << p.use_count() << " ";
q.reset();
cout << p.use_count();
return 0;
}
- A.
1 1
- B.
1 2
- C.
Sign up free to see the answer and a step-by-step explanation.