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
+1 -2
View File
@@ -1,4 +1,3 @@
{
"index": "Introduction",
"declarations": "Declarations"
"index": "Introduction"
}
@@ -1,11 +1,11 @@
# Variables
```c
int x = 20;
```
# Functions
# Defining functions
```c
int my_func(int x) {
printf("the number is: %d", x)
}
```
# Calling functions
```c
my_func(69);
```
+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
```