File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
03_memory_management/slides Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 8
8
9
9
\section {Arrays }
10
10
11
- \begin {frame }[fragile]{Arrays}
11
+ \begin {frame }[fragile,t ]{Arrays}
12
12
\begin {onlyenv }<1>
13
13
\begin {block }{Arrays\ldots }
14
14
\begin {itemize }
@@ -25,7 +25,8 @@ \section{Arrays}
25
25
\begin {onlyenv }<2>
26
26
\begin {itemize }
27
27
\item The size of arrays must be known at compile time
28
- \item Arrays can also be \alert {allocated dynamically}
28
+ \item Arrays (and other types) can also be
29
+ \alert {allocated dynamically}
29
30
\end {itemize }
30
31
\begin {cpp }
31
32
int n = 5;
@@ -56,9 +57,7 @@ \section{Arrays}
56
57
57
58
\section {Pointers }
58
59
59
- % Example of pointers to stack that go out of scope in code!
60
-
61
- \begin {frame }[fragile]{Pointers}
60
+ \begin {frame }[fragile,t]{Pointers}
62
61
\begin {onlyenv }<1>
63
62
\begin {block }{Pointers\ldots }
64
63
\begin {itemize }
@@ -94,8 +93,10 @@ \section{Pointers}
94
93
\item Careful with static memory!
95
94
\end {itemize }
96
95
\begin {cpp }
97
- int x = 5 ;
96
+ int x = 3 ;
98
97
int x_ptr = &x;
98
+
99
+ *x_ptr = 5;
99
100
\end {cpp }
100
101
\end {block }
101
102
\end {onlyenv }
You can’t perform that action at this time.
0 commit comments