Skip to content

Commit da295d0

Browse files
authored
Create FunctionReturningStruct.rs
1 parent 7af3077 commit da295d0

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
struct Point {
2+
x: i32,
3+
y: i32,
4+
}
5+
6+
fn main() {
7+
let point = create_point(10, 20);
8+
println!("Point: ({}, {})", point.x, point.y);
9+
}
10+
11+
fn create_point(x: i32, y: i32) -> Point {
12+
Point { x, y }
13+
}

0 commit comments

Comments
 (0)