Содержание
- 2. Practice Problem 1: Input a number and output it’s bits in a sequence.
- 3. Practice Problem 2: Find the sum of squares of numbers from 1 to N Input: 4
- 4. Practice Problem 3: Find the hypotenuse of a triangle (legs are given) Input: 3 4 Output:
- 5. Practice Problem 4: Find max and min of two numbers without using conditions Input: 3 4
- 6. Practice Problem 5: Find the number of paired bits in the binary representation of an integer
- 7. Practice Problem 6: Let’s consider sets of: Digits [10] Latin letters (both capital and lowercase ones)
- 8. Arrays Variable is like a cell in a storage room But what if we want to
- 9. Arrays a = You can think of the index as the distance from the leftmost element.
- 10. Arrays When creating an array, you need to specify its size: int a[6]; By default, as
- 11. Practice Task 1: A sequence of n numbers is entered on the keyboard. Print numbers in
- 12. Arrays and const qualifiers If we combine array modifier and const qualifier, we’ll create a const-qualified
- 13. Declaration point of an array int x[x]; Compilation error, x is undefined. int x = 2;
- 14. Arrays I would like to be able to use arrays even if the size is large.
- 15. What happens at the physical level When a program is launched, the operating system allocates a
- 16. What happens at the physical level Another example:
- 17. What happens at the physical level Example with an array (note, that array is placed on
- 18. What happens at the physical level The area of memory discussed is called the stack. What
- 19. Pointers We smoothly arrived at the concept of a pointer. What it is? Pointer is a
- 20. Operations with pointers 1) Unary operator &, aka address-of (don’t confuse with the binary bitwise operator
- 21. Operations with pointers 3) Incrementing / decrementing pointers. By adding a number to the pointer, you
- 22. Operations with pointers 4) Difference of two pointers. By subtracting two pointers, you will know the
- 23. Operations with pointers 5) Operator [], aka subscript operator. Applies to arrays. a[i] returns the array
- 24. Operations with pointers In fact, when the [] operator is applied to the array a, the
- 25. Operations with pointers It is possible to access memory not associated with the current array.
- 26. Dynamic memory You cannot allocate very large arrays, because the stack size is limited. But how,
- 27. Operators new and delete Operator new: Allocates new one cell.s Operator delete: Deallocates one cell. Operator
- 28. Operators new and delete, syntax One cell: Array: 4 in this case is the size of
- 29. Operators new and delete Now is the time to talk about how to declare arrays that
- 30. Example Input two arrays of doubles and output sum of these arrays.
- 31. Const qualifier and pointers Let me remind you that C ++ has a const keyword, which
- 32. Const qualifier and pointers A pointer to a const returns a const when dereferenced. A pointer
- 33. Swap Let's imagine the following problem: we want to swap the values of variables. Moreover, we
- 34. Swap When we pass an argument to a function by value (as in the previous example),
- 35. Swap We can improve the code a bit by keeping the const rule, which states: everything
- 36. References In fact, before the invention of C ++, the method I showed was the only
- 37. References In Python, for example, if we create a list and create a variable to which
- 38. References To create a reference to a variable in C ++, you must use the ampersand
- 39. References References can be passed to functions. In this case, we will NOT create a copy,
- 40. References Moreover, references can not only be received by functions, but also returned from them! However,
- 41. Const qualifier and references Just like with pointers, we can create references to constants. In this
- 42. Casts There is a so-called C-style cast operator, which allows you to convert variables of different
- 43. Casts static_cast: This is a compile-time conversion. If static_cast fails to convert the original variable to
- 44. Casts const_cast is a conversion "through" a constant. This is the only cast that violates the
- 45. Problem A sequence of 2D points is specified as a sequence of pairs (x, y). It
- 47. Скачать презентацию





![Practice Problem 6: Let’s consider sets of: Digits [10] Latin letters (both](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/1034013/slide-6.jpg)





![Declaration point of an array int x[x]; Compilation error, x is undefined.](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/1034013/slide-12.jpg)









![Operations with pointers 5) Operator [], aka subscript operator. Applies to arrays.](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/1034013/slide-22.jpg)
![Operations with pointers In fact, when the [] operator is applied to](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/1034013/slide-23.jpg)





















in the country. story telling
Заместитель директора по УВР Салимгареевой Гузелии Фаритовны
Мониторинг ИКТ в сфере культуры г. Москвы Н.В. Браккер, Л.А. Куйбышев Центр по проблемам информатизации сферы культуры (Центр ПИК) А
Презентация на тему "Использование инновационных педтехнологий как средство повышения качества образования школьников" - ск
Ёлка на каждый день
Овца в волчьей шкуре. Синопсис
Музыкальные инструменты
Повелители времени или тайм-менеджмент для обучающихся СПБ ГБ ПОУ Охтинский колледж
Современная тактика ВС РФ
стишок little mouse
Презентация на тему ИСТОРИЯ ДРЕВНЕЙ РУСИ Верования восточных славян
History of game consoles
История боевого вертолёта Ми - 24
Уголовное право. Источником уголовного права
Заботливым родителям о программе!
IV Форум практической психологии образования Челябинской области. Мастер-класс Прививка любви
Новое учебно-методическое обеспечение в условиях инновационного образования
Введение в инженерные практики XP Anton Katkov
РУССКИЙ ЯЗЫК4 КЛАСС
Римские каникулы
2-ші сабақ ІР адрестеу және домендік атаулар жүйесі (1) (1)
Вариант оформления проекта Территория 2020 (1)
Геометрия молекул
Республика Бурятия
Большой Кремлевский дворец
Формирование ключевых компетенций обучающихся через внедрение в педагогическую практику современных образовательных технологи
О порядке передачи отдельных полномочий Российской Федерации в области лесных отношений субъектам Российской Федерации
Химические свойства альдегидов