1
00:00:00,180 --> 00:00:05,520
All right, so once again, we'll come back to another video dealing with the overloaded operators.

2
00:00:07,110 --> 00:00:16,800
So in this lecture, we're going to go over how to overload the output and input operators that you

3
00:00:16,800 --> 00:00:18,750
would use, see out and see in.

4
00:00:20,550 --> 00:00:32,880
So yes, it is possible to do something like this scenario where we would be able to use see out with

5
00:00:32,880 --> 00:00:36,980
an object like hard to use.

6
00:00:38,580 --> 00:00:42,390
So you notice right now it's giving us a little error here.

7
00:00:42,660 --> 00:00:48,240
So it's just saying that no operator matches these upper ends.

8
00:00:48,240 --> 00:00:52,890
Upper end types are and shows you that we're trying to output a car.

9
00:00:54,210 --> 00:00:59,580
So this is possible, but we haven't implemented what we need to make this happen.

10
00:01:00,240 --> 00:01:08,130
What's happening is that the output stream does not know how to output our abstract data type, just

11
00:01:08,130 --> 00:01:14,550
like it didn't know how to add our abstract data types together until we told it how to write.

12
00:01:16,410 --> 00:01:21,600
So we're going to have to overload this operator as well.

13
00:01:22,350 --> 00:01:24,930
And so let's go ahead and talk about how to do that.

14
00:01:26,170 --> 00:01:30,880
So, of course, we're going to want to put a prototype in our header file here.

15
00:01:31,870 --> 00:01:36,430
But this is going to be a slightly different prototype and I'll tell you why.

16
00:01:36,460 --> 00:01:41,440
So I'm about to introduce another new concept for C++.

17
00:01:42,190 --> 00:01:50,440
So what we need to print out our car is most likely information about it, right?

18
00:01:51,310 --> 00:01:54,670
So a lot of the data members are would contain the information.

19
00:01:55,660 --> 00:01:58,930
And we wanted to put these as private data members, right?

20
00:02:01,120 --> 00:02:12,070
So let's say that when we see out a car, we want it to print out it's, let's say, brand model and

21
00:02:12,070 --> 00:02:12,970
paint color.

22
00:02:14,310 --> 00:02:18,420
All right, let's just say that's what we want to print out when we print out of the car, we want this

23
00:02:18,420 --> 00:02:22,230
information to be displayed in the console to the user.

24
00:02:23,730 --> 00:02:26,460
The only problem is that these are private.

25
00:02:26,820 --> 00:02:29,520
And so if we're coming from some client code.

26
00:02:31,290 --> 00:02:36,000
You know, how would we how would we access these, I mean, if you're thinking, well, we never had

27
00:02:36,000 --> 00:02:38,280
a problem in these other operators.

28
00:02:40,110 --> 00:02:42,440
You know, we were able to do plus.

29
00:02:42,530 --> 00:02:42,990
Right.

30
00:02:43,040 --> 00:02:47,930
And if we go in here, for example, let's go down to the plus.

31
00:02:48,590 --> 00:02:52,910
We were able to refer to our data and refine because we did the scope resolution.

32
00:02:54,070 --> 00:03:04,750
The only problem is that this time we do not want our overloaded operator to have the scope resolution

33
00:03:04,750 --> 00:03:06,580
because it's not going to work out.

34
00:03:08,270 --> 00:03:14,390
Yet we still need we still need access to the private data members.

35
00:03:15,700 --> 00:03:22,210
So the reason is is because the way that this overloaded output operator works is that.

36
00:03:23,300 --> 00:03:30,200
We're going to need to pass in an output stream that's going to come from me, so if I hop back over

37
00:03:30,200 --> 00:03:39,680
here to Maine, if we see out the car, it expects the output stream object to be passed over to the

38
00:03:39,680 --> 00:03:42,040
function as a parameter.

39
00:03:42,050 --> 00:03:47,300
So kind of, you know, like like this is so what we're going to do is we're actually going to pass

40
00:03:47,300 --> 00:03:48,500
this as well, right?

41
00:03:48,860 --> 00:03:53,210
This will be the object that we want to print out, which in this example that I come into that would

42
00:03:53,210 --> 00:03:54,050
be car too.

43
00:03:54,980 --> 00:03:59,270
But the thing that we also need is we need before this, we need some other.

44
00:04:02,050 --> 00:04:08,350
Parameter and that is going to be the output stream object, and since we're passing that output stream

45
00:04:08,350 --> 00:04:16,750
that way, we're not really referring to the this object because that's not really an output stream,

46
00:04:16,750 --> 00:04:16,930
right?

47
00:04:16,930 --> 00:04:23,520
So we have to pass that and we have to use that output stream to print out the data members.

48
00:04:23,530 --> 00:04:27,250
And since we have to use that alpha stream to print out the data members.

49
00:04:28,340 --> 00:04:33,040
We're going to need access to those data members, and so there's a way to do this.

50
00:04:34,050 --> 00:04:38,040
And it's by using a special word called Friend.

51
00:04:40,140 --> 00:04:42,210
So what is friend?

52
00:04:42,240 --> 00:04:47,490
Well, in this case, what we're talking about is a friend function.

53
00:04:48,150 --> 00:04:53,430
So we're going to make our function here that is an overloaded operator for our output stream.

54
00:04:54,810 --> 00:05:02,410
But when you put friend in front of something, it basically just gives you access to the private data

55
00:05:02,460 --> 00:05:02,790
members.

56
00:05:02,790 --> 00:05:03,120
So.

57
00:05:04,670 --> 00:05:10,190
You might have some functions sometimes that maybe come from another class, like, let's say there

58
00:05:10,190 --> 00:05:14,090
was something in your step here.

59
00:05:16,180 --> 00:05:26,650
Where you were like, you know, Driver is there was some driver class and you wanted to have some function

60
00:05:26,650 --> 00:05:36,070
that just, I don't know, like connect car or something like that or you relate the driver to the car,

61
00:05:36,340 --> 00:05:40,450
you're able to have some other scope resolution for some other class.

62
00:05:41,020 --> 00:05:50,770
Yet you can still have access to the data members of the car class, the private data members, as long

63
00:05:50,770 --> 00:05:53,200
as you declare that function a friend.

64
00:05:54,950 --> 00:06:01,100
So we're going to use the French word to make our overloaded output stream operator.

65
00:06:01,940 --> 00:06:06,590
And so what we are going to do is we're going to put that in.

66
00:06:06,620 --> 00:06:12,890
What is going to return is it's going to return the output stream back to us and that output stream

67
00:06:12,890 --> 00:06:14,720
is the one that's getting passed as a parameter.

68
00:06:14,720 --> 00:06:15,950
So let's see what this looks like.

69
00:06:15,950 --> 00:06:17,530
So we're going to return an output stream.

70
00:06:17,540 --> 00:06:18,800
So this is post stream.

71
00:06:19,430 --> 00:06:21,710
To do this, I'm going to need to add this up here.

72
00:06:21,710 --> 00:06:24,410
If you don't already have this, you need to add Io stream.

73
00:06:25,680 --> 00:06:30,440
So since I'm not using the standard namespace, I'm going to put STD, colon, colon.

74
00:06:31,170 --> 00:06:39,060
And so it's going to return and stream by reference the ampersand because it wants to return the exact

75
00:06:39,060 --> 00:06:41,940
same same old stream that we're referring to.

76
00:06:42,450 --> 00:06:48,690
And what this is going to be is operator like that because that's software we want to overload.

77
00:06:49,080 --> 00:06:51,180
And so this is where the old stream comes from.

78
00:06:51,210 --> 00:06:52,260
So it's in here.

79
00:06:52,260 --> 00:07:01,500
So I'm going to say, oh, stream by reference, and I'm just going to call this outputs outs for output

80
00:07:01,500 --> 00:07:01,890
stream.

81
00:07:03,540 --> 00:07:12,300
And so what's happening is that we're going to take in this output stream and we're going to refer to

82
00:07:12,330 --> 00:07:15,840
data members of the past object.

83
00:07:15,850 --> 00:07:23,460
So I'm going to say Konst Car and OBJ, just like we have before and the goal of what we're trying to

84
00:07:23,460 --> 00:07:29,010
do is refer to the private data members of this right.

85
00:07:29,010 --> 00:07:30,510
Like these things down here?

86
00:07:30,630 --> 00:07:33,480
Model brand paint color of the object?

87
00:07:35,230 --> 00:07:42,340
And we're trying to use the output stream that's coming from Maine, so basically it would be this output

88
00:07:42,340 --> 00:07:47,050
stream for sea out would be sent over here into the function as a parameter.

89
00:07:49,620 --> 00:07:54,030
And the reason that we're going to need it to be a friend is the fact that we want to have access to

90
00:07:54,030 --> 00:08:00,120
these private members, even though you know we're trying to refer, we want to be able to refer to

91
00:08:00,120 --> 00:08:02,520
the private members of this right.

92
00:08:05,100 --> 00:08:08,190
So this object right here and use it in this output stream.

93
00:08:08,910 --> 00:08:13,770
And that's the reason why we need to call it a friend so it can have access to these for this object.

94
00:08:16,950 --> 00:08:22,740
So let's go ahead and look at how we would implement this, so I'm going to go over to the CP file,

95
00:08:23,610 --> 00:08:26,730
so I think I'm just going to add it right here above the plus operator.

96
00:08:27,990 --> 00:08:32,130
So I'm going, I don't need to put the word friend in here.

97
00:08:32,190 --> 00:08:36,870
I can just put friend in the header file for a prototype.

98
00:08:37,440 --> 00:08:44,610
And what it's going to do is basically in the compiler is just has this list of everything, like every

99
00:08:44,610 --> 00:08:50,250
method, it's going to have access to private data members and this will kind of get added to that list

100
00:08:51,360 --> 00:08:55,440
every function that has access to the private data members.

101
00:08:55,480 --> 00:08:55,740
Right.

102
00:08:56,040 --> 00:09:03,360
And previously, we've gotten access to those via using the scope resolution.

103
00:09:03,930 --> 00:09:07,530
But now we are going to just have this friend declared.

104
00:09:07,530 --> 00:09:16,140
So we don't need scoped resolution and we can just start typing that we're going to return a return

105
00:09:16,140 --> 00:09:21,930
type, which is O Stream, and it's going to be by reference.

106
00:09:21,930 --> 00:09:25,350
And I'm going to put operator like that.

107
00:09:25,650 --> 00:09:32,270
And now we can start typing out parameters that we have the stream by reference coming, and I'm going

108
00:09:32,280 --> 00:09:33,210
to call it out.

109
00:09:33,210 --> 00:09:39,690
And then we also have a we can make this contact because we're not going to modify the object coming

110
00:09:39,690 --> 00:09:39,810
in.

111
00:09:39,810 --> 00:09:41,010
We're just going to print it out.

112
00:09:41,290 --> 00:09:45,580
And so that's why we can have the car object.

113
00:09:46,020 --> 00:09:51,450
So this would be Konst car and object like that.

114
00:09:52,290 --> 00:09:55,080
And it can be cast because we're just going to print stuff out.

115
00:09:55,080 --> 00:09:58,890
We're not going to try and modify the contents of the past object.

116
00:09:59,930 --> 00:10:01,760
So what can we do right here?

117
00:10:01,790 --> 00:10:06,050
Well, first, I think I'd like to print out a message when we're printing out the car object and I'm

118
00:10:06,050 --> 00:10:14,600
just going to say car information, something like that.

119
00:10:15,200 --> 00:10:21,950
Maybe I'll just put this all caps or something car out of, say, car info like that.

120
00:10:21,950 --> 00:10:26,720
And then what we can do now is we will actually use and I'm not going to you see out.

121
00:10:26,720 --> 00:10:28,670
Sorry, I totally messed that up.

122
00:10:28,910 --> 00:10:31,490
What I want to do is actually use out.

123
00:10:33,140 --> 00:10:37,970
So we're going to this is the output stream that's being passed and it's coming from Seattle, right?

124
00:10:37,970 --> 00:10:44,900
So Seattle, this sea out right here is going to get passed in here as an argument by reference, and

125
00:10:44,900 --> 00:10:51,560
we're going to use that output stream here in this file, in this class, in the implementation.

126
00:10:51,930 --> 00:11:00,410
And so we're using ours and so we're outputting into standard out basically like the standard sea out.

127
00:11:01,440 --> 00:11:02,920
Here, I'm just putting it in line.

128
00:11:03,090 --> 00:11:08,670
But then now what I'm going to do is use Alex again to print out the actual info about the past car

129
00:11:08,670 --> 00:11:13,200
object, which if you look at it here in this example, it'll be car to.

130
00:11:14,930 --> 00:11:21,080
So I'm going to say object dot, and now I can reference all of these things without there being problems

131
00:11:21,080 --> 00:11:22,670
because this is a friend function.

132
00:11:23,570 --> 00:11:27,420
So let's say, how about the brand first?

133
00:11:28,340 --> 00:11:38,960
And what I want to do is probably say, let's just say brands like that.

134
00:11:40,350 --> 00:11:52,980
And then I do and in line, and then I will say, let's say model actually changes to make because I

135
00:11:52,980 --> 00:11:54,270
think it makes us a better word.

136
00:11:54,690 --> 00:11:55,760
We have brand is right.

137
00:11:56,820 --> 00:12:03,600
Yeah, we have brands, our data member, but I'm just going to say make their OK and then we can put

138
00:12:03,600 --> 00:12:12,840
an object that model and then we'll do them in line and then we can do paint color.

139
00:12:13,320 --> 00:12:20,500
So I'll just say color and then we'll do object paint color.

140
00:12:22,530 --> 00:12:23,430
OK, cool.

141
00:12:23,490 --> 00:12:26,880
So every time we print out a car object, this is where print out.

142
00:12:27,240 --> 00:12:32,310
And remember that what we're returning is an output stream, so we actually need to hand back this output

143
00:12:32,310 --> 00:12:33,060
stream, right?

144
00:12:33,390 --> 00:12:37,560
So we're going to print this stuff out and then that's going to get sent back to where it was called

145
00:12:37,560 --> 00:12:38,310
from in Maine.

146
00:12:38,670 --> 00:12:42,210
So I am going to put a return out here.

147
00:12:43,370 --> 00:12:44,930
And we're going to return that by reference.

148
00:12:47,720 --> 00:12:51,810
Because we hear that you see there's a reference on the return tape, so obviously taking this out,

149
00:12:51,840 --> 00:12:56,300
you notice this output stream by reference the data type and we're turning this.

150
00:12:56,330 --> 00:12:58,340
So this is the same thing as a return time.

151
00:13:00,710 --> 00:13:00,980
All right.

152
00:13:00,980 --> 00:13:02,980
So let's go ahead and see if this works.

153
00:13:03,050 --> 00:13:06,980
So if everything is all good, then in Maine we uncovered this.

154
00:13:07,220 --> 00:13:12,080
What should happen is that it should say like, Oh, see how interesting I'm trying to see how a car

155
00:13:12,290 --> 00:13:13,460
I'm going to go in here.

156
00:13:13,880 --> 00:13:20,120
And since this is already declared a friend, I'm going to go ahead and go into this function right

157
00:13:20,120 --> 00:13:20,540
here.

158
00:13:20,650 --> 00:13:26,630
It's defined as the overloaded operator for the output stream, and I'm just going to print out whatever's

159
00:13:26,630 --> 00:13:29,300
here to the output stream that was coming from Maine.

160
00:13:30,500 --> 00:13:35,420
And now we can access these private members due to the way that we set this up as a friend.

161
00:13:37,310 --> 00:13:37,550
Cool.

162
00:13:37,610 --> 00:13:42,830
So let's go ahead and test that out, then I'm going to go ahead and save this and I will save this

163
00:13:42,830 --> 00:13:43,310
file.

164
00:13:44,710 --> 00:13:46,300
And I will save this file.

165
00:13:46,390 --> 00:13:49,810
I could just do save all, but I just to explicitly do that.

166
00:13:50,410 --> 00:13:52,450
So go ahead and compile it.

167
00:13:52,930 --> 00:13:57,460
We'll go ahead and run it, and let's see what it says.

168
00:13:58,480 --> 00:14:05,090
So let me go ahead and scroll up, and there we go, look, so we printed out car two.

169
00:14:05,110 --> 00:14:09,250
You know this car to here when we made it, says white Ford Fiesta, right?

170
00:14:10,340 --> 00:14:10,880
And.

171
00:14:12,150 --> 00:14:19,730
When we do this nine, 11, it prints it out all fancy like with this information and it says car info

172
00:14:19,740 --> 00:14:24,050
make Ford Model Fiesta Color White so pretty cool right now.

173
00:14:24,060 --> 00:14:31,290
You have a way to just see out your abstract data types and you, as the programmer, are the one who

174
00:14:31,290 --> 00:14:33,960
can define how that gets printed out.

175
00:14:34,290 --> 00:14:41,580
So when the user of your code base, your library wants to, you know, do stuff with cars, they can

176
00:14:41,580 --> 00:14:45,650
print it out and it will just print out this fancy thing that you made each time they try and print

177
00:14:45,660 --> 00:14:46,650
a car object out.

178
00:14:48,080 --> 00:14:49,520
So pretty cool, right?

179
00:14:50,570 --> 00:14:52,010
Yeah, definitely pretty cool.

180
00:14:52,610 --> 00:14:59,480
So the next thing that we want to do is the input stream operator because we can do the same same exact

181
00:14:59,480 --> 00:15:00,870
thing for the input.

182
00:15:00,920 --> 00:15:03,710
So let's head back over to our header file.

183
00:15:04,220 --> 00:15:09,290
And so we're going to make something that looks very similar, except it's just going to be slightly

184
00:15:09,290 --> 00:15:09,590
different.

185
00:15:09,590 --> 00:15:12,620
It's still going to be a friend because I still want access to this memory.

186
00:15:12,620 --> 00:15:14,150
So we're going to set in this time.

187
00:15:14,690 --> 00:15:17,810
And what we're going to do actually here is Ice Stream.

188
00:15:18,200 --> 00:15:25,490
Oops, I stream my reference and you know, these are just going in the other direction.

189
00:15:26,480 --> 00:15:29,450
And then we're going to get an ice stream coming in, right?

190
00:15:29,450 --> 00:15:32,660
And I'm going to call this ends for input stream.

191
00:15:33,260 --> 00:15:35,330
And this time we're not going to put a cast.

192
00:15:35,540 --> 00:15:36,770
Oh, I spelled that wrong.

193
00:15:37,910 --> 00:15:43,490
This time we're not going to put a contest object because we actually want to modify it, right?

194
00:15:43,490 --> 00:15:45,530
So we don't want it to be a constant.

195
00:15:45,890 --> 00:15:50,810
This one, we could have it be a constant because we were just trying to print stuff out of that.

196
00:15:50,810 --> 00:15:52,250
We're trying to change its data.

197
00:15:52,940 --> 00:15:55,820
This time we're going to be modifying the data.

198
00:15:56,030 --> 00:15:56,480
So.

199
00:15:57,990 --> 00:16:02,980
Let's go ahead and say car and OBJ.

200
00:16:05,820 --> 00:16:06,210
Cool.

201
00:16:06,420 --> 00:16:09,870
So now we have our input stream prototype.

202
00:16:09,900 --> 00:16:11,700
Let's go over here to cart that.

203
00:16:13,560 --> 00:16:16,360
And I'm going to say study.

204
00:16:18,360 --> 00:16:18,660
Oops!

205
00:16:19,560 --> 00:16:21,090
Ice cream, ice cream.

206
00:16:22,380 --> 00:16:27,600
I scream and scream and up for a tour,

207
00:16:34,320 --> 00:16:36,420
and then we have our car objects.

208
00:16:39,840 --> 00:16:40,230
Cool.

209
00:16:43,310 --> 00:16:47,780
So now what we're going to do is the same thing that we're actually going to set these data members.

210
00:16:47,780 --> 00:16:57,200
So what I can do is just have the ends here and we'll say object dot.

211
00:16:58,760 --> 00:17:04,170
Let's say we just want to change the model and paint color.

212
00:17:04,190 --> 00:17:05,750
What if we just change?

213
00:17:08,720 --> 00:17:13,640
What if we just change like the paint color or something, we could probably do that?

214
00:17:14,180 --> 00:17:15,860
So if we want to put some?

215
00:17:19,390 --> 00:17:21,100
I guess we could put all three of these.

216
00:17:21,850 --> 00:17:26,590
We could just change, you know, if you want to exchange your car, let's say you just want to input

217
00:17:26,590 --> 00:17:32,830
a car, you have car two and then you exchange it for another car by inputting new stuff in that object

218
00:17:32,830 --> 00:17:33,400
will change.

219
00:17:33,790 --> 00:17:38,190
So we could say, what if we just say model and paint color?

220
00:17:38,200 --> 00:17:41,110
How about that you can exchange it for a different one.

221
00:17:41,140 --> 00:17:42,160
Actually, we'll put all three.

222
00:17:42,160 --> 00:17:42,880
We'll put out three.

223
00:17:43,780 --> 00:17:46,240
You could put the brand.

224
00:17:46,420 --> 00:17:50,230
So we'll just say input to object brand.

225
00:17:53,970 --> 00:18:06,120
And then we'll just say and and then we'll say object dot model, and then we'll say and and then say,

226
00:18:06,120 --> 00:18:14,400
OK, that paint color closely to all these strings that will come in and then we'll go ahead and just

227
00:18:14,820 --> 00:18:18,450
return our input stream.

228
00:18:19,930 --> 00:18:23,260
So let's go ahead and go back to Maine.

229
00:18:23,280 --> 00:18:25,980
I'm going to go ahead and save this and let's test this out.

230
00:18:25,990 --> 00:18:28,560
So we're going to have to enter stuff in our program.

231
00:18:29,130 --> 00:18:31,350
So we'll go down here.

232
00:18:31,380 --> 00:18:39,180
Let's just say you kind of mess with car for or against Mr. Car to get odometer car, get paint.

233
00:18:39,930 --> 00:18:40,320
Cool.

234
00:18:40,350 --> 00:18:47,010
So we'll go ahead and put car two here.

235
00:18:47,010 --> 00:18:52,560
So if we say, uh, see in and we say.

236
00:18:55,630 --> 00:18:58,720
Let's put a little smile first of the FTC out

237
00:19:01,750 --> 00:19:02,540
input.

238
00:19:04,390 --> 00:19:13,370
Let's just say make model color for car.

239
00:19:15,670 --> 00:19:16,140
Cool.

240
00:19:16,360 --> 00:19:17,740
So we'll do that.

241
00:19:19,830 --> 00:19:24,840
And then we'll do a speedy scene and or scene into car two.

242
00:19:25,380 --> 00:19:26,100
How about that?

243
00:19:27,210 --> 00:19:31,200
So let's go ahead and try this out, so I'll go ahead and save.

244
00:19:33,150 --> 00:19:38,100
And then actually, what we want to do is probably let's see our car too after that.

245
00:19:38,490 --> 00:19:42,570
So I should be out and I won't just say.

246
00:19:45,550 --> 00:19:53,920
Let's just say a new car to think so.

247
00:19:58,100 --> 00:19:59,960
Well, something like that.

248
00:20:03,520 --> 00:20:06,190
And then let's see our car, too.

249
00:20:06,900 --> 00:20:06,940
And

250
00:20:10,570 --> 00:20:11,260
how about that?

251
00:20:12,990 --> 00:20:19,350
So let's go ahead and save this, and then we'll compile it and run it, so compile that.

252
00:20:20,120 --> 00:20:22,360
Let's go ahead and run it, OK?

253
00:20:22,380 --> 00:20:25,170
Input make model color for the car.

254
00:20:25,440 --> 00:20:28,560
So when we print it out, if we go up here.

255
00:20:30,200 --> 00:20:31,280
You can see it right here.

256
00:20:33,070 --> 00:20:33,920
Car info.

257
00:20:33,940 --> 00:20:34,960
Ford Fiesta Way.

258
00:20:35,080 --> 00:20:36,940
So now we're being asked to change that.

259
00:20:37,450 --> 00:20:46,130
So let's just say Subaru, and we'll say out back and blue.

260
00:20:48,780 --> 00:20:50,580
So let's see what is said.

261
00:20:51,800 --> 00:20:52,160
Cool.

262
00:20:52,400 --> 00:20:56,100
So we put a Subaru Space, Outback Space Blue.

263
00:20:56,390 --> 00:20:59,150
Know the strings are parsed in that way between white space.

264
00:20:59,480 --> 00:21:03,650
So it read that into the make model and color.

265
00:21:03,860 --> 00:21:09,650
And we said new car to info below, and it printed out that nice thing.

266
00:21:09,650 --> 00:21:12,680
Right now, Car two is a Subaru Outback.

267
00:21:12,680 --> 00:21:13,340
That's blue.

268
00:21:14,490 --> 00:21:15,610
So pretty cool, right?

269
00:21:15,630 --> 00:21:25,050
We have a way to read in and print out our objects so we can read in the data into them and print them

270
00:21:25,050 --> 00:21:26,430
out in whatever way we want.

271
00:21:28,670 --> 00:21:33,740
So it's pretty nice that people can just simply use this operator with it now, and you don't have to

272
00:21:33,740 --> 00:21:36,440
do any extra work, you don't have to set up a special function for it.

273
00:21:37,760 --> 00:21:41,030
You could just have it really accessible to the user.

274
00:21:42,710 --> 00:21:52,610
All right, so with that, I might be going over a few more operators, but I might actually just have

275
00:21:52,610 --> 00:21:59,000
them as some homework for you all to kind of look up some of the other ones like.

276
00:22:01,060 --> 00:22:08,260
Maybe doing like multiplication operator for the mathematical ones overloaded and then maybe like some

277
00:22:08,260 --> 00:22:15,370
less than and greater than ones for the logical and then, you know, I kind of showed you these ones

278
00:22:15,370 --> 00:22:21,730
here for the output operator, but there are still some other operators that you can do like you could

279
00:22:21,730 --> 00:22:27,310
do like the Plus Plus operator, pretty much anyone that you can think of, like minus minus plus plus.

280
00:22:29,290 --> 00:22:30,200
Not equal to.

281
00:22:30,220 --> 00:22:33,190
We didn't do that, but they're they're all very closely related.

282
00:22:33,640 --> 00:22:41,200
I've kind of just shown you the three different types like versions or I guess categories of operators,

283
00:22:41,200 --> 00:22:41,860
you could say.

284
00:22:43,150 --> 00:22:46,000
And that should be enough to get you going with overloaded operators.

285
00:22:46,000 --> 00:22:48,970
But I'll try and include some practice problems, I think, at some point.

286
00:22:49,960 --> 00:22:50,980
So it kind of depends.

287
00:22:50,980 --> 00:22:55,900
We might do more of that or maybe move on to some other topics because we still have some object oriented

288
00:22:55,900 --> 00:22:56,200
stuff.

289
00:22:56,920 --> 00:23:00,880
OK, so hopefully that made sense and I will see you in the next lecture.
