WEBVTT

00:00.560 --> 00:02.880
So over some odds and ends.

00:02.900 --> 00:08.830
But I noticed that I made a mistake in the imitation last time if want.

00:08.900 --> 00:14.190
Is a point to her break statement.

00:14.800 --> 00:22.020
So if you saw before it actually outplayed both this and this.

00:22.450 --> 00:23.950
When we lost.

00:24.090 --> 00:24.970
OK.

00:25.110 --> 00:27.870
So always remember the break statements.

00:27.920 --> 00:31.480
So just being a little bit careless there.

00:31.480 --> 00:36.270
So now that we have this fixed this is a major implementation of it.

00:36.300 --> 00:42.730
There's a couple things I want to do though to make our life easier.

00:42.730 --> 00:54.700
So one of those things is going to so far we've only had one kind of big file of stuff of code and I

00:54.700 --> 00:57.880
want to be able to reuse some of the code that we have.

00:57.880 --> 01:05.890
So for example this character that has the prompt in the air and also this character which has the valid

01:05.950 --> 01:07.220
inputs.

01:07.330 --> 01:08.020
OK.

01:08.980 --> 01:14.000
So how I'm going to do that is I'm going to say right click on this source.

01:14.030 --> 01:20.680
So the source of this fact that's yeah that's fine.

01:20.690 --> 01:27.520
Right click on the source and you say new header file and we're going to say we're going to call it

01:27.600 --> 01:29.080
utils.

01:29.260 --> 01:33.000
So for you to see finish

01:39.760 --> 01:54.750
this and call it Eutelsat each actually going in or open this and we're going to have a what's called

01:54.750 --> 02:04.560
a header file and this header file will have some sort of declarations of our of our kind of utility

02:04.560 --> 02:05.520
functions that.

02:05.550 --> 02:06.250
Yeah.

02:06.300 --> 02:11.590
So example one of the utility functions we have is this good character.

02:11.670 --> 02:13.350
So are you going to copy this

02:16.140 --> 02:22.760
and paste it in our header file this.

02:23.480 --> 02:27.760
And we're going to do the same thing for this other function to

02:30.470 --> 02:35.440
copy that paste it over

02:46.040 --> 02:46.760
so

02:50.210 --> 03:00.710
we have this header file now and release something with the preprocessor and rushing to say hash if

03:01.100 --> 03:05.200
in def.

03:05.870 --> 03:09.380
And or and say You too.

03:09.450 --> 03:14.030
So your score is going to say I'm just going to score you two.

03:14.050 --> 03:26.310
It's underscore each every state irritated fine score on the score you tildes each school score that

03:28.340 --> 03:29.660
and are going to say.

03:29.720 --> 03:35.610
And if so what this will do is remember I said.

03:35.960 --> 03:38.240
These include statements.

03:38.270 --> 03:46.090
So if you go to hangman P and go all the way up to the top These include statements will actually paste

03:46.180 --> 03:49.430
in the entire.

03:49.840 --> 03:55.130
So I said before like the entire tired IO stream gets pasted in.

03:56.110 --> 04:00.770
We have this so that it doesn't get pasted in multiple times.

04:00.770 --> 04:06.010
OK so if it's already pasted in that's what this kind of says.

04:06.130 --> 04:16.310
So if it's not pasted in right we'll actually paste it in there so that clears up like if you get if

04:16.310 --> 04:22.460
we include this in many different files it would create would actually paste it in many different files

04:22.460 --> 04:29.230
and you'll see some pretty wicked errors from the compiler if you don't do so.

04:29.420 --> 04:31.030
Just follow this and you should be fine.

04:31.030 --> 04:34.670
And in fact follow this for any kind of header file do.

04:35.210 --> 04:52.700
It's quite useful and rude to actually right click again and say new source file and say you tills CTP

04:55.490 --> 05:06.100
center and in here we're going to actually take these functions and are going to cut them from this

05:06.100 --> 05:06.730
file.

05:08.310 --> 05:14.740
And runty paste them in the Eutelsat CBP file.

05:14.950 --> 05:20.200
Surgeons cut them from this and paste them right here.

05:22.780 --> 05:30.850
And now we also need also the includes for this.

05:30.870 --> 05:42.860
So first include we need is actually the utilized R.H. if you include utl Zych and you have to include

05:45.490 --> 05:58.160
stream that so we can use CNC and correctly Stream.

05:58.670 --> 06:14.870
And we're going to also include CC type for the two lower and Alpha ingress using namespace standard

06:17.590 --> 06:20.530
like gets rid of all the errors.

06:20.700 --> 06:27.850
So now that we don't have this in hangman anymore you will have some errors.

06:28.140 --> 06:37.210
But to get rid of them here we're going to use a include tools to h

06:39.750 --> 06:40.680
h.

06:41.880 --> 06:44.580
And we should see that it still is for

06:50.440 --> 06:50.990
in

06:53.840 --> 06:54.530
O.

06:54.660 --> 07:00.300
And there's one other thing we need is a more characters.

07:00.300 --> 07:00.970
Of course

07:04.320 --> 07:08.050
it's just that it's actually pretty inside of here.

07:09.950 --> 07:10.400
This

07:17.910 --> 07:22.480
structure in everything should work.

07:26.590 --> 07:30.070
So that's one thing so.

07:30.400 --> 07:35.850
So now why we've done this is now we can use this for multiple projects.

07:35.990 --> 07:44.320
So you're going to include this utils agency BP into our next project so we don't have to always keep

07:44.440 --> 07:49.790
kind of pasting in like this get character which don't need this anymore right way.

07:49.870 --> 07:51.390
Get rid of that.

07:51.580 --> 07:53.600
You don't need this get character

07:57.320 --> 07:59.840
character function.

08:00.020 --> 08:01.900
I would want to implement it every time.

08:01.910 --> 08:08.920
Could just include these two files into our project and we'll have them pay off if they're right that

08:08.950 --> 08:11.170
every time just nice.

08:11.200 --> 08:21.050
So now that we've actually added the utilities H&amp;R CVP there's one other thing I want to do.

08:21.360 --> 08:23.320
Save that for the next lecture.
