From 5453e7a05c0609922a0afe0b5241913cdaa53e7f Mon Sep 17 00:00:00 2001 From: Aditya K Date: Thu, 6 Jul 2023 10:23:43 +0530 Subject: [PATCH] Update ownership.md. Borrowing the variables in the first problem --- solutions/ownership/ownership.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/solutions/ownership/ownership.md b/solutions/ownership/ownership.md index 1237fc02..b41ba9f3 100644 --- a/solutions/ownership/ownership.md +++ b/solutions/ownership/ownership.md @@ -31,6 +31,15 @@ fn main() { } ``` +``` +fn main() { + let x = String::from("hello, world"); + let y = &x; + println!("{},{}",x,y); +} + +``` + 2. ```rust