Mastering C++ pointers: the pros and cons of (raw) pointers | pointer usage with const

  Рет қаралды 1,505

Code for yourself

Code for yourself

Күн бұрын

Pointers sometimes have a bad vibe. But they are an important construct in C++. Today we talk about how to use them to reduce the amount of pain that they cause 😅 We cover what they actually are, their difference to references and how (and where) to use const correctly with pointers.
📚 As always, the script to the video lives here: github.com/cpp-for-yourself/s...
Hope you enjoy this one! Please leave any suggestions below the video or tell what you liked about the video!
*Contents*
00:00 - Intro
00:47 - What are pointers after all?
01:55 - How to create pointers in the code
02:08 - The address operator
02:37 - How to get the underlying data?
03:34 - The arrow operator
04:27 - The main difference between pointers and references
05:14 - Pointers pointing nowhere
06:17 - Dereferencing a nullptr
06:58 - const with pointers
09:10 - Summary

Пікірлер: 8
@Anton-vu1ou
@Anton-vu1ou Жыл бұрын
Great video! As always, high quality and quite detailed!
@CodeForYourself
@CodeForYourself Жыл бұрын
Glad you enjoyed it!
@olegonka8801
@olegonka8801 Жыл бұрын
Крутий контент! Для початківців класне відео
@CodeForYourself
@CodeForYourself Жыл бұрын
Дякую! Сподіваюсь далі підуть відео також для тих "хто вже вміє" 😉
@marwanzaghloul6065
@marwanzaghloul6065 Жыл бұрын
Great video, thank you!
@CodeForYourself
@CodeForYourself Жыл бұрын
My pleasure!
@bsdooby
@bsdooby Жыл бұрын
`east const` vs `const west`: the geographic orientation represents the type. E.g., "int \*const ptr" [ptr cannot be reseated], or "int const\* ptr" [ptr cannot change the value it is pointing to]; backslash added to show the star character.
@CodeForYourself
@CodeForYourself Жыл бұрын
Yep, pretty much
C++ object lifecycle 101: the essentials
9:28
Code for yourself
Рет қаралды 950
Re-inventing move semantics in modern C++ in 13 minutes
13:20
Code for yourself
Рет қаралды 6 М.
3M❤️ #thankyou #shorts
00:16
ウエスP -Mr Uekusa- Wes-P
Рет қаралды 11 МЛН
БОЛЬШОЙ ПЕТУШОК #shorts
00:21
Паша Осадчий
Рет қаралды 8 МЛН
Получилось у Вики?😂 #хабибка
00:14
ХАБИБ
Рет қаралды 6 МЛН
Неприятная Встреча На Мосту - Полярная звезда #shorts
00:59
Полярная звезда - Kuzey Yıldızı
Рет қаралды 7 МЛН
Pointers and Dynamic Memory in C++ (Memory Management)
13:54
ReelLearning
Рет қаралды 378 М.
Smart Pointers in C++ (Stop Using new?)
17:18
Caleb Curry
Рет қаралды 10 М.
unique_ptr: C++'s simplest smart pointer
11:54
mCoding
Рет қаралды 40 М.
const_cast In C++
10:54
CppNuts
Рет қаралды 35 М.
Don't use static (outside of classes) in modern C++
15:56
Code for yourself
Рет қаралды 4,9 М.
you will never ask about pointer arithmetic after watching this video
8:01
Low Level Learning
Рет қаралды 233 М.
Why are function pointers useful?
6:43
CodeVault
Рет қаралды 29 М.
POINTERS in C++
16:59
The Cherno
Рет қаралды 1 МЛН
3M❤️ #thankyou #shorts
00:16
ウエスP -Mr Uekusa- Wes-P
Рет қаралды 11 МЛН