Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions arr_as_func_arg/slides.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,7 +21,7 @@ as Function Arguments

---
title: prerequisites-pointers
layout: two-cols
zoom: 1.25
---

# pointers
Expand DownExpand Up@@ -79,6 +79,8 @@ assign
pointer arithmetic
-->

---
zoom: 1.25
---

# arrays
Expand DownExpand Up@@ -118,9 +120,9 @@ int main() {
#include <stdio.h>
int main() {
int arr[5] = {1, 2, 3, 4, 5};
printf("First element: %p\n", &arr[0]); // 304
printf("Second element: %p\n", &arr[1]); // 308
printf("Third element: %p\n", &arr[2]); // 312
printf("First element's address: %p\n", &arr[0]); // 304
printf("Second element's address: %p\n", &arr[1]); // 308
printf("Third element's address: %p\n", &arr[2]); // 312
}
```
```c
Expand All@@ -142,6 +144,8 @@ access elements
arrays are stored in contiguous memory locations
-->

---
zoom: 1.25
---

```c {monaco-run}
Expand DownExpand Up@@ -173,6 +177,7 @@ For Arrays:

---
title: arrays-as-function-arguments
zoom: 1.25
---

# arrays as function arguments
Expand DownExpand Up@@ -239,7 +244,7 @@ int main() {
title: problems with arrays as function arguments
layout: two-cols
---
# isssues
isssues

````md magic-move
```c
Expand DownExpand Up@@ -435,7 +440,7 @@ int main() {

::right::

# code editor
code editor

```c {monaco-run}{autorun:false,height:'auto'}
#include <stdio.h>
Expand All@@ -453,6 +458,8 @@ int main() {
5. now check with any integer pointer
-->

---
zoom: 1.25
---

# easter egg
Expand DownExpand Up@@ -537,6 +544,8 @@ int main() {

</div v-click>

---
zoom: 1.25
---

# practice
Expand DownExpand Up@@ -577,4 +586,4 @@ void squareArray(int *arr, int size, int *NEWarr) {
NEWarr[i] = arr[i] * arr[i];
}
}
-->
-->