How to get length of arrays in C++ (7 ways)

preview_player
Показать описание
This video will teach you some seven ways to get the length of arrays in C++. It uses seven different examples to explain the process.
00:00:07 - Introduction
00:02:34 - Example one: Using the sizeof() function to calculate array length
00:04:55 - Example two: Using a pointer to find the length of array
00:06:49 - Example three: Using the STL (array header file) to get array length
00:09:16 - Example four: Using the C++17 size() function to find array length
00:12:00 - Example five: Using the iterator feature in the STL for array length
00:15:39 - Example six: Counting through array element by element
00:19:14 - Example seven: Define function based on built-in sizeof() function
Рекомендации по теме
Комментарии
Автор

Thank you for watching. Help to grow this channel. Kindly subscribe if you haven't already. Share or comment.

zebracode
Автор

can someone explain why *(&arr + 1) - arr works?

xxnotmuchxx
join shbcf.ru