Skip to content

Commit 87ed2f7

Browse files
feat: update
1 parent 37ba8ab commit 87ed2f7

9 files changed

Lines changed: 121 additions & 12 deletions

File tree

src/content/01-topics/04-function-1/0-Overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@
9696

9797
---
9898
## 📑 Slides & Materials
99-
- 👨‍🏫 [Professor Slides (PDF)](4-ProfessorSlides.md)
100-
- 🧑‍🏫 [TA Workshop Slides (PDF)](5-TASlides.md)
99+
- 👨‍🏫 [Professor Slides (PDF)](01-topics/04-function-1/4-ProfessorSlides.md)
100+
- 🧑‍🏫 [TA Workshop Slides (PDF)](01-topics/04-function-1/5-TASlides.md)
101101

102102
---
103103
## 🛠️ Workshop & Assignments

src/content/01-topics/04-function-1/1-Workshop.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
> - Ask your TA — that’s what we’re here for.
3939
4040
- [Topic Q&A](3-Q&A.md)
41-
- [Professor Slides](4-ProfessorSlides.md)
42-
- [TA Slides](5-TASlides.md)
41+
- [Professor Slides](01-topics/04-function-1/4-ProfessorSlides.md)
42+
- [TA Slides](01-topics/04-function-1/5-TASlides.md)
4343
---
4444
## ⚖️ Licensing & Usage
4545

src/content/01-topics/05-arrays/0-Overview.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
---
9696
## 🛠️ Workshop & Assignments
9797

98-
- 💬 [Workshop Questions](1-Workshop.md)
98+
- 💬 [Workshop Questions](01-topics/05-arrays/1-Workshop.md)
9999
- 🧮 [Assignments]()
100100
-[Q&A and Common Issues]()
101101

@@ -106,9 +106,8 @@
106106

107107
---
108108
## ⏩ Navigation
109-
110-
- ⬅️ [Previous Topic: Functions 1]()
111-
- ➡️ [Next Topic: Functions 2]()
109+
- ⬅️ [Previous Topic: Functions 1](01-topics/04-function-1/0-Overview.md)
110+
- ➡️ [Next Topic: Functions 2](01-topics/06-functions-2/0-Overview.md)
112111
---
113112

114113
> [!tip] Tip

src/content/01-topics/05-arrays/1-Workshop.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
> - Ask your TA — that’s what we’re here for.
3939
4040
- [Topic Q&A](3-Q&A.md)
41-
- [Professor Slides](4-ProfessorSlides.md)
42-
- [TA Slides](5-TASlides.md)
41+
- [Professor Slides](01-topics/05-arrays/4-ProfessorSlides.md)
42+
- [TA Slides](01-topics/05-arrays/5-TASlides.md)
4343
---
4444
## ⚖️ Licensing & Usage
4545

src/content/01-topics/06-functions-2/0-Overview.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
---
5656
## 📑 Slides & Materials
57-
- 🧑‍🏫 [TA Workshop Slides (PDF)](5-TASlides.md)
57+
- 🧑‍🏫 [TA Workshop Slides (PDF)](01-topics/06-functions-2/5-TASlides.md)
5858

5959
---
6060
## 🛠️ Workshop & Assignments
@@ -71,6 +71,7 @@
7171
## ⏩ Navigation
7272

7373
- ⬅️ [Previous : Arrays](../05-arrays/0-Overview.md)
74+
- ➡️ [Next Topic: Pointers](../07-pointers/0-Overview.md)
7475

7576
---
7677

src/content/01-topics/06-functions-2/1-Workshop.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
> - Ask your TA — that’s what we’re here for.
3939
4040

41-
- [TA Slides](5-TASlides.md)
41+
- [TA Slides](01-topics/06-functions-2/5-TASlides.md)
4242
---
4343
## ⚖️ Licensing & Usage
4444

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# 🧭 Topic: Pointers
2+
3+
> [!info] **Quick Overview :** This topic covers how memory is accessed and managed in C++, starting from memory addresses and the address-of operator (`&`), and moving to pointers as variables that store addresses. It explains dereferencing, pointer arithmetic, pointer types (including `void*` and pointer-to-pointer), and why all pointers have the same size on a given architecture. The relationship between arrays and pointers is discussed, including common pitfalls when passing arrays to functions. The overview also contrasts stack and heap memory, introduces dynamic allocation with `new` and `delete`, and highlights common pointer errors such as wild and dangling pointers, variables going out of scope, and the use of `nullptr`. Finally, it clarifies the role of `const` with pointers, compares pointers with reference variables, and explains why pointers are used in functions for efficiency, output parameters, and managing dynamic memory.
4+
5+
6+
## 📌 Covered in This Topic
7+
- **Memory addresses**
8+
- What a memory address is and what it represents
9+
- **The address-of operator (`&`)**
10+
- How `&` is used to obtain a variable’s address
11+
- **Pointers**
12+
- What a pointer is
13+
- Pointer size (independent of the pointed type)
14+
- **Wild pointers**
15+
- What they are and why they are dangerous
16+
- **Raw pointers vs smart pointers (brief)**
17+
- Why raw pointers exist
18+
- A short mention of `unique_ptr`, `shared_ptr`, `weak_ptr`
19+
- **Array names and pointers**
20+
- How array names decay to pointers
21+
- Problems when passing arrays to functions (loss of size information)
22+
- **Dereferencing (`*`)**
23+
- Accessing the value a pointer points to
24+
- Using dereferencing to access array elements
25+
- **Pointer arithmetic**
26+
- How incrementing/decrementing pointers works
27+
- Relation to the pointed data type
28+
- **Size of pointers**
29+
- Why all pointers have the same size on a given architecture
30+
- **Pointer data types**
31+
- Why pointers must have a data type
32+
- How the type affects dereferencing and arithmetic
33+
- **Void pointers (`void*`)**
34+
- What they are
35+
- Limitations and use cases
36+
- **Pointer to pointer**
37+
- Why and when double pointers are used
38+
- **Stack vs heap**
39+
- Why the stack is not always sufficient
40+
- When dynamic (heap) allocation is required
41+
- **Dynamic memory allocation**
42+
- `new` and `delete`
43+
- `new[]` and `delete[]`
44+
- **Reference variables**
45+
- What references are
46+
- Differences between references and pointers
47+
- **Dangling pointers**
48+
- How dangling pointers are created
49+
- How to avoid and handle them
50+
- **`nullptr`**
51+
- Why it exists
52+
- Difference from `NULL` and `0`
53+
- **Const and pointers**
54+
- `const int*`
55+
- `int* const`
56+
- `const int* const`
57+
- **Variables going out of scope**
58+
- Lifetime of local variables
59+
- Effects on pointers and references
60+
- **Pointers and functions**
61+
- Passing pointers to functions (input)
62+
- Returning pointers from functions (output)
63+
- Why pointers are used: efficiency, modification, dynamic memory, and shared data
64+
65+
---
66+
## 📑 Slides & Materials
67+
- 👨‍🏫 [Professor Slides (PDF)](01-topics/07-pointers/4-ProfessorSlides.md)
68+
- 🧑‍🏫 [TA Workshop Slides (PDF)](01-topics/07-pointers/5-TASlides.md)
69+
70+
---
71+
## 🛠️ Workshop & Assignments
72+
73+
- 🧮 [Assignments](2-Assignment.md)
74+
-[Q&A and Common Issues]()
75+
76+
---
77+
## 🌐 Additional Resources
78+
79+
80+
---
81+
## ⏩ Navigation
82+
83+
- ⬅️ [Previous : Functions 2 - Recursion](../06-functions-2/0-Overview.md)
84+
- ➡️ [Next Topic: File & Struct](../08-file-struct/0-Overview.md)
85+
86+
87+
---
88+
89+
> [!tip] **Tip :**
90+
>
91+
> If something doesn’t make sense — **don’t stay stuck alone**. Ask the TA to clarify it right away. Often, a quick question can save you a lot of time and frustration. Remember: if you’re confused, chances are others are too.
92+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
## 🔗 Download
3+
- [Download PDF - Lecture 07](https://drive.usercontent.google.com/u/0/uc?id=1NpWCnRqdEIZ7gSrdul7p2YoOLNZ0_cTB&export=download)
4+
## View PDF Online
5+
6+
### Lecture 07
7+
8+
<iframe src="https://docs.google.com/gview?embedded=true&url=https://drive.usercontent.google.com/u/0/uc?id=1NpWCnRqdEIZ7gSrdul7p2YoOLNZ0_cTB&export=download" width="100%" height="700px" frameborder="0"> </iframe>
9+
10+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
## 🔗 Download
3+
- [Download PDF - Pointers](https://drive.usercontent.google.com/u/0/uc?id=1C7j89GnSQhdO8SiohPHVCPbe8u8_8W2b&export=download)
4+
## View PDF Online
5+
### Pointers
6+
7+
<iframe src="https://docs.google.com/gview?embedded=true&url=https://drive.usercontent.google.com/u/0/uc?id=1C7j89GnSQhdO8SiohPHVCPbe8u8_8W2b&export=download" width="100%" height="700px" frameborder="0"> </iframe>

0 commit comments

Comments
 (0)