Dayrvia
C++

C++ · Ownership · Practice questions

Try 2 questions on C++ · Ownership, then read the explanations and review the related concepts.

Practice questions

Choose an answer and move to the next question. Grade the last one to see explanations and review links.

2 questions
Q1 Which pointer now owns the integer?
auto a = std::make_unique<int>(9);
auto b = std::move(a);
Q2 What happens to the allocated integer on normal return?
void run() {
    auto p = std::make_unique<int>(4);
}
Original practice questions written for Dayrvia.