Тёмный

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

Code for yourself
Подписаться 3,4 тыс.
Просмотров 1,5 тыс.
50% 1

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

Опубликовано:

 

28 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 8   
@olegonka8801
@olegonka8801 Год назад
Крутий контент! Для початківців класне відео
@CodeForYourself
@CodeForYourself Год назад
Дякую! Сподіваюсь далі підуть відео також для тих "хто вже вміє" 😉
@Anton-vu1ou
@Anton-vu1ou Год назад
Great video! As always, high quality and quite detailed!
@CodeForYourself
@CodeForYourself Год назад
Glad you enjoyed it!
@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
Const correctness in C++
10:02
Просмотров 2,6 тыс.
Recycled Car Tyres Get a Second Life! ♻️
00:58
Просмотров 3,5 млн
Smart Pointers in C++ (Stop Using new?)
17:18
Просмотров 10 тыс.
Go | 6 Unique Techniques
9:04
Просмотров 252
unique_ptr: C++'s simplest smart pointer
11:54
Просмотров 40 тыс.
SMART POINTERS in C++ (for beginners in 20 minutes)
24:32
Headers and libraries, but with classes
7:07
Просмотров 1,4 тыс.
Dynamic Memory Allocation -- C++ Pointers Tutorial [8]
18:25
All Rust string types explained
22:13
Просмотров 151 тыс.
Functions vs Classes: When to Use Which and Why?
10:49
Просмотров 143 тыс.