Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,390 --> 00:00:01,550
What is going on, guys?
2
00:00:01,940 --> 00:00:08,970
I mean, this video, what I want to talk about before we move on to the next video, to the next exercise,
3
00:00:08,970 --> 00:00:16,740
the next challenge that we are about to do, I want us to talk about how to use Boulle data types,
4
00:00:16,740 --> 00:00:20,760
so how to use Bolian data types.
5
00:00:21,630 --> 00:00:30,780
So similarly to the jurors double's floating point Char's and so on, which every one of them represents
6
00:00:30,780 --> 00:00:31,990
different data types.
7
00:00:32,460 --> 00:00:39,360
We also have a bool data type that its values are either true or false.
8
00:00:39,390 --> 00:00:45,450
So just like you had a floating point, number four, for example, I don't know, three point fourteen
9
00:00:45,870 --> 00:00:48,120
or any other floating point number.
10
00:00:48,120 --> 00:00:55,000
And you also had the jurors, which had simply a broader range of values.
11
00:00:55,410 --> 00:01:00,690
We also have a bull data type, which can be either true or false.
12
00:01:00,760 --> 00:01:03,840
OK, it is very useful and very efficient.
13
00:01:03,840 --> 00:01:10,980
Instead of using like, let's say, a double variable to hold either one or zero.
14
00:01:11,730 --> 00:01:15,390
And it consumes a lot of more and a lot more memory.
15
00:01:15,630 --> 00:01:23,490
We can use a bull for situations where we know that the status of the value inside the variable should
16
00:01:23,490 --> 00:01:24,810
be either a true or false.
17
00:01:24,810 --> 00:01:25,780
Just two options.
18
00:01:25,800 --> 00:01:31,160
OK, that's something that you will encounter a lot in your programming career.
19
00:01:31,860 --> 00:01:35,940
And there are a couple of a couple of ways to do so.
20
00:01:36,210 --> 00:01:40,770
While in other programming languages it is already builtin.
21
00:01:40,770 --> 00:01:49,440
But there are there are basically two options that I think I should mention right now, although there
22
00:01:49,440 --> 00:01:57,060
are also additional options, at least three or four or even five other options to use booleans in our
23
00:01:57,060 --> 00:01:58,230
C programming language.
24
00:01:58,440 --> 00:02:00,890
But two of them I will show you right now.
25
00:02:00,900 --> 00:02:08,490
So the first one goes like this and you should include additional, let's say, additional library.
26
00:02:08,490 --> 00:02:12,540
And it's called include include what should we include?
27
00:02:12,900 --> 00:02:21,390
We should include SD Bulle SD and just search for Buhle standard boolean dot header.
28
00:02:21,420 --> 00:02:25,000
And now if you would like to create some boolean variable.
29
00:02:25,120 --> 00:02:28,710
OK, so let's say you would like to create a boolean variable.
30
00:02:28,710 --> 00:02:32,210
Bool still raining.
31
00:02:32,470 --> 00:02:36,930
OK, still raining and put it put its value to be true.
32
00:02:36,990 --> 00:02:45,390
OK and you simply created a variable of a boolean type with the value of true and you will simply,
33
00:02:45,630 --> 00:02:47,350
you may simply use something like that.
34
00:02:47,370 --> 00:02:56,580
So while it is still raining, OK, while these, these are result here is true then in this case let's
35
00:02:56,580 --> 00:02:57,510
just use print.
36
00:02:57,510 --> 00:03:03,000
If it is still raining, it's still raining.
37
00:03:03,600 --> 00:03:05,790
Rain, rain, rain.
38
00:03:05,790 --> 00:03:07,230
OK, something like that.
39
00:03:07,470 --> 00:03:14,670
So and this iteration will run as long as I don't know, as long as some condition happen.
40
00:03:15,210 --> 00:03:19,630
So when these conditions of still raining will be equal to falls.
41
00:03:19,660 --> 00:03:29,820
OK, this loop, this while loop will be over and then you will stop the execution.
42
00:03:29,820 --> 00:03:32,700
So once you're out, let's say printf.
43
00:03:32,970 --> 00:03:34,680
Oh, it's stopped.
44
00:03:34,980 --> 00:03:36,480
It's stopped raining.
45
00:03:37,620 --> 00:03:39,740
Finally a sunny day.
46
00:03:40,050 --> 00:03:42,000
OK, so very simple.
47
00:03:42,000 --> 00:03:44,910
That's option number one to use the booleans.
48
00:03:44,910 --> 00:03:53,220
The simply include the SDD bool standard Bildad header and the other option would be to use to use an
49
00:03:53,220 --> 00:03:53,850
enum.
50
00:03:53,880 --> 00:04:01,950
OK, I don't remember if we talked about it about it at this point, but I think I can simply write
51
00:04:01,950 --> 00:04:07,350
it down to you that you will be able to know another way of using Boolean.
52
00:04:07,360 --> 00:04:14,820
So it goes like this typedef that we definitely spoke of ENUM and then we write two options.
53
00:04:14,820 --> 00:04:19,410
So false and through these are two options for our Bulle.
54
00:04:20,040 --> 00:04:22,080
OK, so that's how you do it.
55
00:04:22,350 --> 00:04:29,340
That's how you can use another option of using booleans and don't get afraid of these body if you are
56
00:04:29,340 --> 00:04:30,510
not familiar with it.
57
00:04:30,520 --> 00:04:35,460
We already talked about it or we will talk about it in the future.
58
00:04:35,460 --> 00:04:37,650
Let me know if you have any questions about it.
59
00:04:37,770 --> 00:04:45,330
And basically now you know how to use two options of booleans in our or C programming language and you
60
00:04:45,330 --> 00:04:48,570
are ready to move on to the next exercises.
5816
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.