Skip to content

Commit c823dc8

Browse files
authored
Create StructExample.rs
1 parent 6964bd8 commit c823dc8

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

DataTypes/StructExample.rs

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

0 commit comments

Comments
 (0)