课程: Complete Guide to C++ Programming Foundations
免费学习该课程!
今天就开通帐号,24,100 门业界名师课程任您挑!
The vector class
- [Instructor] Although we have talked about arrays, I don't recommend using them for your applications as a first option. Instead, you should consider using SDL vectors. These are dynamic-size containers. That means that you may resize them in case you need to have data to your collection or delete elements. The memory required for vectors is managed for you. That means that you don't need to allocate or free that memory manually. However, if the objects you are putting inside your vectors allocate memory manually, well, you're responsible for those as usual. Vector is a generic container class. That means that vectors can be implemented for storing any type of element, ints, floats, strings, or even objects of your own classes. It also means that there are numerous member functions for manipulating vectors conveniently available within the class. Vectors are a part of the C++ standard template library. This is a special set of containers, functions and algorithms included in the C++…
内容
-
-
-
-
-
-
(已锁定)
Arrays7 分钟 27 秒
-
Pointers7 分钟 59 秒
-
(已锁定)
How arrays and pointers are related5 分钟 14 秒
-
(已锁定)
Using objects with pointers10 分钟 56 秒
-
(已锁定)
The vector class5 分钟
-
(已锁定)
Using objects with vectors6 分钟 29 秒
-
(已锁定)
References4 分钟 56 秒
-
(已锁定)
C strings11 分钟 16 秒
-
(已锁定)
The string class4 分钟 14 秒
-
(已锁定)
Solution: Vector manipulation2 分钟
-
(已锁定)
-
-
-
-
-
-