#include <iostream> #include <memory> using namespace std; class Sensor { public: int read() { return 42; } }; int main() { // your code here: declare unique_ptr<Sensor> and call read() using ->p unique_ptr<Sensor> p{new Sensor}; cout << "Sensor reading: " << p->read() << "\n"; return 0; }
Test Cases
Test Results
Input
Expected Output
Sensor reading: 42