diff --git a/Presentations/07-Pointers-and-References/ptrs-and-refs.tex b/Presentations/07-Pointers-and-References/ptrs-and-refs.tex index 19e658d..5673dc0 100644 --- a/Presentations/07-Pointers-and-References/ptrs-and-refs.tex +++ b/Presentations/07-Pointers-and-References/ptrs-and-refs.tex @@ -511,7 +511,7 @@ \footnote{\url{https://github.com/Nekrolm/ubbook/blob/master/lifetime/use\_after\_free\_in\_general.md}}. \begin{myinplacelisting}[minted language=cpp] -#include +#include int* get_ptr() { int x {}; @@ -519,8 +519,8 @@ } int main() { - int* p const = get_x(); - std::cout << *x // undefined behaviour + int* const p = get_ptr(); + std::cout << *p // undefined behaviour << std::endl; } \end{myinplacelisting}