1 00:00:05,550 --> 00:00:09,550 In this video, we'll look at the syntax for accessing individual 2 00:00:09,550 --> 00:00:10,550 vector elements. 3 00:00:11,430 --> 00:00:16,030 The first way to access vector elements is to use the array syntax we've already learned, 4 00:00:16,030 --> 00:00:19,030 using the subscript operator. That's the square brackets. 5 00:00:19,930 --> 00:00:23,730 We use the name of the vector, followed by the square brackets with the index of the vector 6 00:00:23,730 --> 00:00:26,230 element we want inside the square brackets. 7 00:00:26,630 --> 00:00:30,830 For example, test score sub-1 refers to the element at index 1 8 00:00:30,830 --> 00:00:32,390 in the test scores vector. 9 00:00:32,390 --> 00:00:34,050 In the code example at the bottom, 10 00:00:34,050 --> 00:00:37,350 you can see that the syntax is exactly as it was for arrays. 11 00:00:37,750 --> 00:00:41,550 Remember that vector subscripting or indexing is the same as in arrays. 12 00:00:42,050 --> 00:00:46,250 It starts at 0, so the first element of an array is at index 0. 13 00:00:46,650 --> 00:00:50,250 It's important to understand when we use the subscript operator with a vector, 14 00:00:50,250 --> 00:00:52,250 no bounds checking will be done. 15 00:00:52,650 --> 00:00:54,950 You have to do it yourself as with arrays. 16 00:00:54,950 --> 00:00:57,550 Now let's look at another way of accessing vector elements. 17 00:00:58,350 --> 00:01:01,710 We can also access vector elements using the at method. 18 00:01:02,210 --> 00:01:04,010 This is the vector syntax. 19 00:01:04,370 --> 00:01:07,670 Since when we create a vector, we're really creating an object 20 00:01:07,670 --> 00:01:09,570 in object-oriented jargon. 21 00:01:09,570 --> 00:01:12,570 Then we can ask objects to perform operations. 22 00:01:12,570 --> 00:01:14,770 These operations are called methods. 23 00:01:14,770 --> 00:01:18,920 The syntax is simple. The object name, in this case, the name of the vector 24 00:01:18,920 --> 00:01:21,520 followed by a . called the .operator, 25 00:01:21,920 --> 00:01:24,920 followed by the name of the operation we want performed. 26 00:01:24,920 --> 00:01:26,120 This is the method name. 27 00:01:26,620 --> 00:01:29,820 Don't worry about the jargon for now, it will come before you know it, 28 00:01:29,820 --> 00:01:33,120 and we'll cover it in depth when we talk about object-oriented programming. 29 00:01:33,520 --> 00:01:38,180 The c++ plus vector has a method or operation called "at", a-t. 30 00:01:38,780 --> 00:01:43,180 So you can ask the vector to give you an element at a specific position, 31 00:01:43,180 --> 00:01:45,480 which you provide inside the parentheses. 32 00:01:45,840 --> 00:01:49,840 This style is actually much more intuitive since the name "at" provides context. 33 00:01:50,140 --> 00:01:54,540 So in the example, we've declared and initialized a vector named test scores 34 00:01:54,540 --> 00:01:59,530 to the 5 integers 100, 95, 99, 87 and 88. 35 00:02:00,130 --> 00:02:02,490 If we want to access a specific element, 36 00:02:02,490 --> 00:02:05,790 we use the at method and provide the element index. 37 00:02:06,490 --> 00:02:09,789 You can see that the syntax is very easy to read and understand. 38 00:02:09,789 --> 00:02:11,890 Test scores at 0 39 00:02:11,890 --> 00:02:16,150 will refer to the first element in the vector. That's element at position 0. 40 00:02:16,150 --> 00:02:19,950 We can also use the same syntax when we want to modify vector elements. 41 00:02:20,550 --> 00:02:23,850 In this example, we're reading 5 integers from the console 42 00:02:23,850 --> 00:02:26,850 and storing these elements into the test scores vector. 43 00:02:27,250 --> 00:02:30,550 The last statement is an assignment statement as we saw with arrays. 44 00:02:30,950 --> 00:02:34,150 We're storing 90 into the first element of the test score's vector. 45 00:02:34,920 --> 00:02:39,220 You're probably thinking okay, that's pretty easy. Vectors are just as easy to use as arrays but 46 00:02:39,220 --> 00:02:41,220 when do they change in size dynamically. 47 00:02:41,820 --> 00:02:45,180 The vector has a method called pushback 48 00:02:45,180 --> 00:02:48,180 that adds a new element to the end of the vector. 49 00:02:48,180 --> 00:02:51,680 Remember, all vector elements must be of the same type, 50 00:02:51,680 --> 00:02:55,880 so the element you add must be of the same type as all the other vector elements. 51 00:02:56,380 --> 00:03:00,740 In this example, we've created a vector called test scores that contains 3 integers: 52 00:03:00,740 --> 00:03:03,040 100, 95 and 99. 53 00:03:03,940 --> 00:03:07,190 If this were an array and we wanted to add another test score, 54 00:03:07,190 --> 00:03:10,190 we'd be stuck since arrays are fixed in size. 55 00:03:10,190 --> 00:03:13,290 However, with vectors, we can use the pushback method 56 00:03:13,290 --> 00:03:16,790 and provide the integer you want to add within the parentheses. 57 00:03:17,390 --> 00:03:20,290 You can see that I'm asking the test scores vector 58 00:03:20,290 --> 00:03:22,590 to push back 80 and then 90. 59 00:03:22,950 --> 00:03:26,250 This will add 80 and then 90 to the end of the vector. 60 00:03:26,250 --> 00:03:30,450 Now the vector will contain five elements: 100, 95, 99, 61 00:03:30,450 --> 00:03:31,750 80 and 90. 62 00:03:32,350 --> 00:03:35,650 How does this work? You don't have to worry about it. That's the beauty of vectors 63 00:03:35,650 --> 00:03:38,650 and of the other classes in the standard template library. 64 00:03:39,050 --> 00:03:42,450 The vector will take care of allocating or de-allocating space, 65 00:03:42,450 --> 00:03:45,350 adding new values to that space and so forth. 66 00:03:45,350 --> 00:03:47,550 You can concentrate on solving your problem. 67 00:03:48,150 --> 00:03:50,450 Okay. But what happens if you're using at 68 00:03:50,450 --> 00:03:53,750 or some other vector method and you go out of bounds? Let's see. 69 00:03:54,450 --> 00:03:58,330 If you go out of bounds, and you're using a method that does bounce checking, 70 00:03:58,330 --> 00:04:00,630 c++ plus will throw an exception. 71 00:04:01,230 --> 00:04:05,590 That's the jargon used to say that an exceptional condition has been encountered 72 00:04:05,590 --> 00:04:07,190 and the program can't continue. 73 00:04:07,790 --> 00:04:10,790 An error message is displayed and the program will terminate. 74 00:04:10,790 --> 00:04:12,090 This is a good thing. 75 00:04:12,090 --> 00:04:15,890 Now you have an error message that tells you what the problem was and you can fix it. 76 00:04:16,589 --> 00:04:18,990 The error message in this case is pretty long, 77 00:04:18,990 --> 00:04:20,990 but it's telling you exactly what happened. 78 00:04:21,589 --> 00:04:25,790 The error message may look different depending on the compiler you have, but the information provided 79 00:04:25,790 --> 00:04:26,790 will be the same. 80 00:04:27,340 --> 00:04:30,700 In this case, I bolded the important parts of the error message. 81 00:04:30,700 --> 00:04:32,600 You can see out of range, 82 00:04:32,600 --> 00:04:35,960 vector range check and the numbers 5 and 2. 83 00:04:36,760 --> 00:04:38,310 When you look back at your code, 84 00:04:38,310 --> 00:04:42,410 you'll see the vector has two elements and you wanted element at index 5. 85 00:04:43,310 --> 00:04:47,810 You want your program to terminate or crash during testing, so you can fix errors, 86 00:04:48,010 --> 00:04:50,110 but you don't want it to crash in production. 87 00:04:50,660 --> 00:04:52,760 This is where you can do exception handling. 88 00:04:52,760 --> 00:04:56,120 This involves catching these exceptions as the program runs 89 00:04:56,120 --> 00:04:59,320 and dealing with them so that the program doesn't crash. 90 00:04:59,320 --> 00:05:03,520 Exception handling is a more advanced topic, but i want to cover the basics, 91 00:05:03,520 --> 00:05:07,120 so there will be a section at the end of the course just on exception handling. 92 00:05:08,020 --> 00:05:10,520 I hope you can see how much better vectors are than arrays, 93 00:05:10,520 --> 00:05:13,420 and why you should use vectors in modern c++. 94 00:05:13,420 --> 00:05:16,320 Now let's head over to CodeLite and use what we learned 95 00:05:16,320 --> 00:05:17,820 and write some code with vectors. 96 00:05:19,420 --> 00:05:23,420 So now I'm in CodeLite. And let's do some examples with vectors. 97 00:05:23,620 --> 00:05:27,720 I'm in the seven section workspace under the vectors project. 98 00:05:27,970 --> 00:05:32,330 And here's my main file. Notice that I'm including the vector include file. 99 00:05:32,330 --> 00:05:35,130 You must do this in order to use vectors. Also, 100 00:05:35,130 --> 00:05:37,530 vectors belong to the standard namespace, 101 00:05:37,530 --> 00:05:41,430 so either you use the namespace standard or you'll have to do std 102 00:05:41,430 --> 00:05:44,530 scope resolution operator everywhere you use vectors. 103 00:05:45,330 --> 00:05:49,230 Let's talk about a couple of different ways to create vectors. In this first example here, 104 00:05:49,230 --> 00:05:51,830 I can create a vector called vowels. 105 00:05:51,830 --> 00:05:54,830 And it's a vector of characters. And that's the syntax. 106 00:05:54,830 --> 00:05:57,630 We put the type inside the angle brackets. 107 00:05:57,630 --> 00:06:00,990 Okay. So in this case, I've got vowels is a vector of characters 108 00:06:00,990 --> 00:06:02,590 and this is an empty vector. 109 00:06:03,090 --> 00:06:06,090 Okay it's of size 0. There's nothing in there right now. 110 00:06:06,090 --> 00:06:09,690 The only way to add things to it is to do something like pushback, 111 00:06:09,990 --> 00:06:13,790 which we'll do in a little bit. The second example creates 112 00:06:13,790 --> 00:06:16,040 a vector called vowels again. 113 00:06:16,040 --> 00:06:19,400 In this case, it's 5 characters long 114 00:06:19,800 --> 00:06:21,800 and each one is initialized to 0. 115 00:06:22,500 --> 00:06:25,500 This third example here which is the one I'm going to use in this example. 116 00:06:25,860 --> 00:06:29,860 I'm using an initializer list here so I'm initializing the vector 117 00:06:29,860 --> 00:06:32,520 vowels, which is again is a vector of characters to 118 00:06:32,520 --> 00:06:36,020 the characters a, e, i, o, u., which are my vowels. 119 00:06:36,620 --> 00:06:41,220 Again, remember that the character literals have single quotes around them, not double quotes. 120 00:06:41,920 --> 00:06:45,220 So at this point, I can simply output vowel sub-0 121 00:06:45,220 --> 00:06:48,220 and vowel sub-4, which i expect to print out a 122 00:06:48,520 --> 00:06:49,880 and u,respectively. 123 00:06:50,480 --> 00:06:52,680 Notice that even though I'm using a vector, 124 00:06:52,680 --> 00:06:55,980 I'm using the array syntax. So it's very, very familiar. 125 00:06:55,980 --> 00:07:00,580 Also remember that using the subscript notation does not 126 00:07:00,580 --> 00:07:01,580 do bounce checking. 127 00:07:02,180 --> 00:07:03,580 Okay. So let me run this. 128 00:07:05,080 --> 00:07:09,480 So there's my sample run. There's my lowercase a, my lowercase u, just what I expect. 129 00:07:12,080 --> 00:07:16,680 All right. So now let's take a look at another declaration of vector. In this first example here, 130 00:07:16,680 --> 00:07:20,580 I'm creating a vector called test scores, which is a vector of integers. 131 00:07:21,180 --> 00:07:24,180 And I'm creating a vector of 3 integers in this case, 132 00:07:24,180 --> 00:07:27,880 all of them will be initialized to 0. In the second example, 133 00:07:28,030 --> 00:07:30,630 I'm creating the test scores vector again. 134 00:07:30,990 --> 00:07:34,690 Obviously, I have to comment them out you can't use the same name twice that's why I'm doing this. 135 00:07:35,290 --> 00:07:40,090 It's a vector of integers, 3 of them, each one is initialized to a 100. 136 00:07:40,590 --> 00:07:44,190 And so those are two variants for constructing these vector objects. 137 00:07:44,190 --> 00:07:46,590 The one I'm going to use is this one right here, 138 00:07:46,590 --> 00:07:49,740 where I'm saying test scores again it's a vector of integers. 139 00:07:49,740 --> 00:07:53,340 And I'm initializing them to 100, 98 and 89. 140 00:07:53,340 --> 00:07:57,240 So in this case, I'm going to get exactly 3 elements 141 00:07:57,240 --> 00:07:59,440 in my vector. My vector will be of size 3. 142 00:07:59,940 --> 00:08:02,140 Okay. So let's comment this out here. 143 00:08:03,040 --> 00:08:06,140 And in this case, I expect it to display 144 00:08:06,140 --> 00:08:08,140 100, 98, 89. 145 00:08:08,140 --> 00:08:12,140 Again, here I'm using the array syntax. So let me run this. 146 00:08:14,340 --> 00:08:18,840 And there you go, 100, 98, 89 using array syntax. 147 00:08:19,440 --> 00:08:24,340 Now we can also use vector syntax. So let me uncomment this. 148 00:08:25,590 --> 00:08:29,990 And now here, you can see I'm saying test_scores.at(0), 149 00:08:30,890 --> 00:08:33,590 test_scores.at(1), test_scores.at(2). 150 00:08:33,990 --> 00:08:38,980 So in this case, I'm using the at method to give me the value at that specific index. 151 00:08:39,640 --> 00:08:42,440 Same idea except that this is a method 152 00:08:42,440 --> 00:08:45,640 and this will be bounce checked, which is very important to understand. 153 00:08:46,940 --> 00:08:51,140 Also after I print out those three numbers, I'm saying there are 154 00:08:51,640 --> 00:08:54,440 so many scores in the vector. Okay. So what does that mean? 155 00:08:54,440 --> 00:08:58,940 Well, notice the size method here. This is a method in the vector class. 156 00:08:59,300 --> 00:09:03,840 So I can have my vector name and I can just say something like .size. It's that simple. 157 00:09:04,240 --> 00:09:07,940 And this will return, however, many items are in the vector right now. 158 00:09:07,940 --> 00:09:11,540 Right now I have 3 of them. So I expect this to say 3 are three 159 00:09:11,540 --> 00:09:13,040 scores in the vector. 160 00:09:13,040 --> 00:09:16,440 Remember, the vector can grow and shrink dynamically. 161 00:09:16,440 --> 00:09:19,440 So it's important to be able to ask it, hey, how big are you? 162 00:09:19,440 --> 00:09:22,740 That's what the size method does. So I'll run this one more time. 163 00:09:24,140 --> 00:09:28,540 And you can see here, my test score is using array syntax 100, 98, 89. 164 00:09:28,940 --> 00:09:32,740 Now my test score is using the vector syntax 100, 98, 89. 165 00:09:32,740 --> 00:09:35,540 We expect that because the the vector hasn't changed. 166 00:09:36,140 --> 00:09:38,740 But here it says, there are three scores in the vector. 167 00:09:38,740 --> 00:09:43,100 So here we're asking the vector, hey, how big are you? What's your size? And it's returning a 3. 168 00:09:43,100 --> 00:09:46,700 In this example here, what we're going to do is we're going to 169 00:09:46,700 --> 00:09:49,600 actually put some information into the vector. 170 00:09:49,600 --> 00:09:51,800 We're going to use the vector syntax from this point forward. 171 00:09:52,570 --> 00:09:55,670 So here, I'm saying enter 3 test scores 172 00:09:55,670 --> 00:09:58,870 and then I'm grabbing three integers from the console 173 00:09:58,870 --> 00:10:03,070 and I'm putting the first one at 0, the second one at 1 and the third one at 2. 174 00:10:03,070 --> 00:10:05,280 So I'm changing those vector elements. 175 00:10:05,640 --> 00:10:09,240 And then I just want to display them out again. So I'll uncomment this. 176 00:10:10,040 --> 00:10:12,400 Okay. So let's do that. I'll build and run again. 177 00:10:15,000 --> 00:10:17,600 Right now we've got 100, 98 and 89 in there. 178 00:10:17,600 --> 00:10:19,800 So let's just say I want 10, 20 and 30. 179 00:10:20,800 --> 00:10:24,600 And I want to display them out. And there you go. Updated test scores is 10, 20 180 00:10:24,600 --> 00:10:29,200 and 30. So you can see that we've actually changed the contents of those vector elements. 181 00:10:30,190 --> 00:10:33,190 Now let's talk a little bit about the dynamic nature of vectors. 182 00:10:33,190 --> 00:10:35,390 This is the part that's really really cool. 183 00:10:35,990 --> 00:10:38,190 I'm going to uncomment this bit out here. 184 00:10:40,550 --> 00:10:44,350 And notice the code here, it says enter a test score to add to the vector. 185 00:10:44,350 --> 00:10:47,650 Remember, the vector at this point has 3 elements in it. 186 00:10:48,350 --> 00:10:50,750 I need to read this into some variable. 187 00:10:50,750 --> 00:10:54,050 So I've created a simple variable right here called score to add. 188 00:10:54,050 --> 00:10:57,250 It's just an integer. This is not a vector. This is not an array. 189 00:10:57,250 --> 00:10:59,850 This is just a plain old integer variable. 190 00:10:59,850 --> 00:11:03,110 I'm initializing it to 0. That's the best practice. 191 00:11:03,110 --> 00:11:06,470 And I'm reading an integer from the keyboard, 192 00:11:06,470 --> 00:11:10,670 from the user and putting it into score to add then. What I'm going to do is 193 00:11:10,670 --> 00:11:13,470 I'm going to tell the test scores vector 194 00:11:13,470 --> 00:11:16,970 to push that integer at the back of the vector. 195 00:11:17,270 --> 00:11:19,370 So it's going to add it to the vector. 196 00:11:19,370 --> 00:11:22,670 If the vector needs to increase in size, it will. 197 00:11:22,670 --> 00:11:25,970 That's nothing we have to do, it handles that automatically. 198 00:11:25,970 --> 00:11:28,630 Then I'm going to say enter one more test score. 199 00:11:28,630 --> 00:11:31,830 So I'll read another test score from the console, 200 00:11:31,830 --> 00:11:33,730 and I'll push that score on. 201 00:11:33,730 --> 00:11:38,230 So at this point when we display, we should have 202 00:11:38,230 --> 00:11:40,530 5 integers now in the vector. 203 00:11:40,930 --> 00:11:44,230 I'm going to display them all at 0, 1, 2, 3 and 4. 204 00:11:44,730 --> 00:11:47,930 And then I'm going to say, hey, test scores, what's your size? 205 00:11:47,930 --> 00:11:51,530 And I expect a 5 here. Okay. So let's try that. 206 00:11:53,530 --> 00:11:56,730 All right. So I'm going to enter my test scores again. I'll say 10, 20 and 30. 207 00:11:58,930 --> 00:12:01,930 Now remember, our vector contains 3 208 00:12:01,930 --> 00:12:04,130 integers right now: 10, 20 and 30. 209 00:12:04,130 --> 00:12:07,130 So let's enter a test score to add. Let's add a 100. 210 00:12:08,430 --> 00:12:11,630 Now it's saying give me one more. Let's put in 211 00:12:11,630 --> 00:12:13,930 105, maybe I got some extra credit. 212 00:12:14,530 --> 00:12:18,630 Now when I press enter, I should expect to see 5 integers displayed 213 00:12:18,630 --> 00:12:22,190 as well as the size of the vector now being 5. So I'm going to press enter 214 00:12:22,790 --> 00:12:24,450 and that's exactly what I see. 215 00:12:24,450 --> 00:12:27,750 The test scores are 10, 20, 30, 100, 105. 216 00:12:28,350 --> 00:12:31,550 Then it says there are now 5 scores in the vector. That's pretty cool. 217 00:12:32,050 --> 00:12:34,750 Let me show you an example of an exception. 218 00:12:36,110 --> 00:12:40,470 Right here, I'm saying this should cause an exception because I'm trying to access 219 00:12:40,470 --> 00:12:44,670 test scores at 10. If I tried to do something like this 220 00:12:44,920 --> 00:12:46,920 and just used array syntax, 221 00:12:48,420 --> 00:12:50,420 like that, no bounds checking will happen. 222 00:12:50,420 --> 00:12:54,920 I might just get a crash with no error message or anything. Instead, I'm actually saying at 223 00:12:55,320 --> 00:12:56,220 10. 224 00:12:57,020 --> 00:13:00,720 And we could try to put a new line. It's not going to matter much because it's not going to do 225 00:13:01,320 --> 00:13:05,520 that because there is no 10th element. Let me run this again, and I'll enter those numbers again. 226 00:13:07,020 --> 00:13:09,320 Okay. So again, we'll say 10, 20, 30. 227 00:13:09,920 --> 00:13:14,020 Let's push in 100 and 105. Now we should get an exception, 228 00:13:14,020 --> 00:13:17,320 and there's the exception. You can see the program is still stopping, 229 00:13:17,720 --> 00:13:19,020 but there's my exception. 230 00:13:19,320 --> 00:13:22,420 Terminate called after throwing an instance of out of range. 231 00:13:23,420 --> 00:13:26,420 There's a range checking problem, which is at 10, 232 00:13:26,420 --> 00:13:27,920 and this guy is 5 big. 233 00:13:28,620 --> 00:13:31,820 So that gives you a really, really good clue as to what's going on. 234 00:13:32,320 --> 00:13:35,120 Right, I'm going to comment that out so it won't affect us again. 235 00:13:35,780 --> 00:13:38,780 And then the last thing we'll do is I'll show you an example of using 236 00:13:38,780 --> 00:13:40,780 a two-dimensional vector. 237 00:13:40,780 --> 00:13:44,780 I'll uncomment all of this out. All right. So here, how do we declare 238 00:13:44,780 --> 00:13:47,880 a two-dimensional vector? Well, a two-dimensional vector 239 00:13:47,880 --> 00:13:51,680 is a vector of vectors. So it's a vector of vectors. 240 00:13:51,680 --> 00:13:55,580 And this is how I would declare a vector of vectors. I want to declare a vector 241 00:13:55,580 --> 00:13:59,940 that contains within it not int, not floats, not doubles, but a vector. 242 00:14:00,440 --> 00:14:03,740 In this case, a vector of integers, and that's my movie ratings. 243 00:14:04,040 --> 00:14:06,240 I can initialize them right here. 244 00:14:06,240 --> 00:14:09,340 So going horizontally that would be the first reviewer, 245 00:14:09,340 --> 00:14:11,340 the second reviewer, the third reviewer. 246 00:14:11,640 --> 00:14:15,940 And going vertically, this would be the first movie, the second movie, the third movie and the fourth movie. 247 00:14:16,540 --> 00:14:21,440 Now just like I showed you in the slides with arrays, I can use array syntax. 248 00:14:21,640 --> 00:14:25,940 So I could say here the movie ratings for reviewer number one using array syntax. 249 00:14:25,940 --> 00:14:31,490 And I would expect this to print out 1, 2, 3, 4, that's the first reviewer, 250 00:14:33,090 --> 00:14:36,890 right up here. And in order to use vector syntax, we just use at,but we use it twice. 251 00:14:37,390 --> 00:14:40,190 Give me the rating at 0 that gives me this guy. 252 00:14:41,090 --> 00:14:44,590 And then once I have that guy, I can take at 0 for him 253 00:14:44,990 --> 00:14:47,190 or at 1 and the next line and so forth. 254 00:14:47,190 --> 00:14:50,690 So if I run this, I would expect to see 1, 2, 3, 4 255 00:14:50,690 --> 00:14:52,290 both times. So let's run it, 256 00:14:54,590 --> 00:14:56,590 and we'll get by this part one more time. 257 00:14:59,190 --> 00:15:02,190 And there you go.Here are the movie ratings for reviewer number one; 258 00:15:02,190 --> 00:15:04,590 array syntax 1, 2, 3, 4. 259 00:15:04,590 --> 00:15:06,590 Here are the movie ratings for reviewer number 2, 260 00:15:06,590 --> 00:15:11,090 that's -- sorry number one again, that's right, using vector syntax 1, 2 3, 4. 261 00:15:12,690 --> 00:15:17,090 Okay. So that basically covers the fundamentals of vectors. 262 00:15:17,090 --> 00:15:20,860 How to use them. There's so much more effect. And we'll talk about all of that 263 00:15:20,860 --> 00:15:22,860 when we talk about the standard template library. 264 00:15:22,860 --> 00:15:25,960 But congratulations, you've just now created objects, 265 00:15:25,960 --> 00:15:29,860 used object methods. And we're on the way to object-oriented programming.