changes
This commit is contained in:
@@ -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
|
||||
```
|
||||
Reference in New Issue
Block a user