Pointers are scary. Unfortunately that previous statement is what many beginners take away when first learning about pointers and the C++ language. In this talk, we will discuss the low level foundations of what a raw pointer is--a variable that stores an address. We will then see some examples of raw pointers for creating data structures, passing data into functions, dynamically allocated arrays, and function pointers. This portion will cover capabilities of raw pointers and syntax: * (asterisk), .(dot) , -> (arrow). By the end of the first portion of the talk, we will find pointers are not scary, but just another tool we can use in our programmers’ toolbox.
After learning the foundations, we are then going to discuss some of the pitfalls of pointers (e.g. nullptr’s, double frees, memory leaks). However, with modern C++, we can abstract away some of these problems using various “smart pointers” built into the standard library in <memory>. Attendees will leave understanding how we can use pointers in a safe manner through the standard library smart pointer abstractions.
ALL TALK SESSIONS CAN BE ACCESSED FROM THE MAIN LOBBY:
https://cppcon.digital-medium.co.uk/