Master the fundamental concepts of rust for systems programming through this focused micro-challenge.
Ownership is why Rust ships in the Linux kernel, Windows, and Android Bluetooth without a GC. The borrow checker encodes rules that C leaves to discipline and sanitizers (see The Rust Book — What is Ownership?).
drop runsrustLoading…
String, Vec, Box) transfer heap ownershipi32, bool, and other trivial types) duplicate bits&T or one &mut T at a time (References and Borrowing)In C there is no borrow checker: "move" is a convention (hand off a pointer and clear the old one), "copy" is assignment of scalar values, and "borrow" is passing a pointer without transferring free responsibility.
Read a mode from stdin (move, copy, borrow, or all) and print the exact lines required by the tests. Prefer the Rust language selector for the idiomatic exercise; the C starter teaches the same ideas with pointers so both languages stay valid.
Implement ownership demos driven by stdin mode.
Modes (first token of stdin):
Exact output lines are fixed by the sample and hidden tests. Do not print extra text.
Success criteria:
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
Every task includes starter code, theory, and hidden tests so you can implement and verify locally in the browser.
How it works