This commit is contained in:
2024-07-26 04:11:14 +02:00
parent 0026b74a4c
commit 2f80aa1a5b
7 changed files with 45 additions and 10 deletions
+23
View File
@@ -0,0 +1,23 @@
# Defining a structure
```c
struct Point {
int x;
int y;
int z;
}
```
# Using a structure as a variable
```rust
Point my_point { x: 0, y: 10, z: 20 };
```
# Using a structure
```rust
Point { x: 30, y: 40, z: 50 }
```
# Getting items from a structure
```rust
my_point.x
```