#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 -> unique_ptr<Sensor> ptr{new Sensor}; printf("Sensor reading: %d\n", ptr->read()); return 0; }
Test Cases
Test Results
Input
Expected Output
Sensor reading: 42