1
00:00:04,210 --> 00:00:07,090
Now, let's talk about the main function.

2
00:00:07,420 --> 00:00:14,960
So we have a function in C++ guide main function where the program execution starts.

3
00:00:15,010 --> 00:00:22,030
So always C++ program execution starts from main function, which means that walked all things we want

4
00:00:22,030 --> 00:00:24,550
to make our computer do.

5
00:00:24,880 --> 00:00:28,030
We should be defining that in, say, this main function.

6
00:00:28,510 --> 00:00:32,020
So I'm writing the main function and the syntax for writing.

7
00:00:32,020 --> 00:00:42,220
The main function is Int Main Bracket Open Close then opened up emphasis on the curly brackets.

8
00:00:42,430 --> 00:00:51,390
No logical things to write inside these curly basis that all things will be executed by the CBB component.

9
00:00:51,700 --> 00:01:01,120
So you will be wearing what is compiler so that in a small definition I can give you compiler is the

10
00:01:01,120 --> 00:01:07,480
way that I block programming code is converted into computers.

11
00:01:07,990 --> 00:01:08,950
Native language.

12
00:01:08,950 --> 00:01:14,440
So computer is not a human being, it's it electronic device altered things.

13
00:01:14,440 --> 00:01:18,970
The computer what to understand should be in a format which it is meant to understand.

14
00:01:19,210 --> 00:01:27,070
Like if I only know English language and if somebody is talking to me in Spanish, I won't be understanding

15
00:01:27,070 --> 00:01:27,470
anything.

16
00:01:27,490 --> 00:01:31,420
Similarly, computer only knows one language for machine language.

17
00:01:31,600 --> 00:01:33,880
It won't understand anything apart from that.

18
00:01:34,150 --> 00:01:40,750
So in order to make computer understand, we will be using machine language because it's the native

19
00:01:40,750 --> 00:01:41,950
language of the computer.

20
00:01:42,190 --> 00:01:44,820
So this language is called High-Level Language.

21
00:01:44,850 --> 00:01:51,400
All the programming languages like C, C++, Java, everything is called High-Level Language.

22
00:01:51,670 --> 00:01:57,760
These are the language which we understand so that we can write programs or instructions, which can

23
00:01:57,760 --> 00:02:05,050
be said like used for creating tasks for which which are meant to be executed by the computer.

24
00:02:06,160 --> 00:02:14,050
But in the case of like high level languages, when we give the high level language to statically to

25
00:02:14,050 --> 00:02:16,030
computer, it won't understand it.

26
00:02:16,600 --> 00:02:21,820
So in order to make the high level language languages more understandable for a computer, we will do

27
00:02:21,820 --> 00:02:27,610
a process called competition, and computation is done by a software like compiler.

28
00:02:27,730 --> 00:02:34,390
So these, like we may be using it, kind of commands to create that compilation process.

29
00:02:34,540 --> 00:02:36,070
So that's about competition.

30
00:02:36,280 --> 00:02:39,070
What are all things we write in the C++ language?

31
00:02:39,220 --> 00:02:43,030
We need to convert it in a language that computers understand.

32
00:02:43,240 --> 00:02:46,390
So that process is done by a software called compiler.

33
00:02:46,540 --> 00:02:49,000
And that process is card combination.

34
00:02:49,010 --> 00:02:55,340
So I will be using this term again and again, and we will be seeing competition throughout the program.

35
00:02:55,360 --> 00:03:03,580
So once the compilation is starting and we start to run the program, all the things written inside

36
00:03:03,580 --> 00:03:09,280
these curly braces or the main function will be executed by the computer.

37
00:03:10,060 --> 00:03:12,550
So let's write out a statement.

38
00:03:12,670 --> 00:03:13,060
See.

39
00:03:15,830 --> 00:03:16,370
Hello.

40
00:03:16,630 --> 00:03:17,090
What?

41
00:03:19,730 --> 00:03:23,870
And we put a semicolon at the end of that statement.

42
00:03:24,410 --> 00:03:33,380
This is because all the C++ programming statements, except some statements will be ending with semicolons.

43
00:03:33,560 --> 00:03:39,170
So these are the statements in C++, and these statements will always end with a semicolon.

44
00:03:39,530 --> 00:03:48,650
So code is that command order function, which will be helping the users to print the values which is

45
00:03:48,650 --> 00:03:51,410
given in their code statement.

46
00:03:51,590 --> 00:04:00,530
So the syntax for using CODIS you have to use this year keyword, then you have to use this two symbols,

47
00:04:01,460 --> 00:04:05,990
which is the greater than grade and then symbols two are pointing towards the Hello world.

48
00:04:06,260 --> 00:04:09,140
So which means we will be printing this statement.

49
00:04:09,620 --> 00:04:16,010
So this is going to this streaming session operator, which will put the data to that standard output

50
00:04:16,160 --> 00:04:21,920
device, which is the monitor, so that all things you like would see our cover and then putting the

51
00:04:21,960 --> 00:04:30,140
stream insertion keyword or symbol that will be put to that monitor or standard output device in that

52
00:04:30,140 --> 00:04:30,740
system.

53
00:04:31,400 --> 00:04:35,270
So this is that in output statement for printing, hello.

54
00:04:35,840 --> 00:04:38,510
Then we will be writing return.

55
00:04:41,080 --> 00:04:41,560
Zero.

56
00:04:42,730 --> 00:04:49,960
So why are you liberating the 10 zero, it's like we have used main function with indigenous prototyping.

57
00:04:50,260 --> 00:04:52,820
So that's why we are using returns zero.

58
00:04:52,870 --> 00:04:58,120
So you will be wondering why this prototyping, why it is written statement everything so that we will

59
00:04:58,120 --> 00:05:00,220
cover in the module card functions.

60
00:05:00,370 --> 00:05:08,020
For now, we'll be writing our first and basic C++ programming program, and you need not to worry about

61
00:05:08,020 --> 00:05:10,080
all these statements meaning it or.

62
00:05:10,150 --> 00:05:15,340
So just see, this is the basic structure of C++ program.

63
00:05:15,550 --> 00:05:19,570
So now we can start running and executing the program.

64
00:05:19,810 --> 00:05:27,060
So first of all, like I have said, this program is in a language which we understand because it's

65
00:05:27,070 --> 00:05:33,160
in the language that seems like computers should Anderson, but it's only a language, which is meant

66
00:05:33,400 --> 00:05:35,800
more easier for us to understand.

67
00:05:36,040 --> 00:05:42,370
So what we need to do is like, we need to convert this language, this program in their statements,

68
00:05:42,790 --> 00:05:45,790
which computer can understand or that machine language.

69
00:05:45,940 --> 00:05:48,670
So we need to compile this program.

70
00:05:48,940 --> 00:05:54,760
So what we do to compile this program is, first of all, I think you are familiar with some of the

71
00:05:54,910 --> 00:05:55,570
next comments.

72
00:05:55,840 --> 00:06:00,610
My location of this particular program is desktop.

73
00:06:00,760 --> 00:06:06,210
So inside my terminal, I will be navigating through desktop then.

74
00:06:06,220 --> 00:06:10,120
Now I need to compile this file so that it will be.

75
00:06:10,120 --> 00:06:14,230
These instructions can be converted into machine instructions.

76
00:06:14,410 --> 00:06:23,200
So I will be comparing this program by writing a code like Commands by G Plus Plus, which is a combination

77
00:06:23,200 --> 00:06:28,020
command which we will use inside Linux or Mac OS.

78
00:06:28,210 --> 00:06:36,460
So Windows, it's kind of different so you can refer to the manual for Windows for compiling the program.

79
00:06:36,460 --> 00:06:38,830
It's available with that here.

80
00:06:39,160 --> 00:06:47,650
C C++ compiler tutorials are available on the Visual Studio board, so D-plus presses the command.

81
00:06:47,710 --> 00:06:49,930
Then I have to write the file name.

82
00:06:50,680 --> 00:06:52,300
Hello, Lloyd Doggett CB.

83
00:06:52,660 --> 00:06:59,770
So what happens when I press enter in this particular command is the D-plus Plus.

84
00:06:59,770 --> 00:07:07,210
Is that on Belarus to the system, it will compile my file Hello World C++ into a meaningful program.

85
00:07:07,390 --> 00:07:08,770
So let's hit.

86
00:07:08,770 --> 00:07:16,300
And so you don't see any kind of commands or get any kind of warning sign at us or here you can just

87
00:07:16,300 --> 00:07:18,820
see a blank next line coming in.

88
00:07:19,000 --> 00:07:21,850
That means your program is compiled successfully.

89
00:07:22,000 --> 00:07:23,200
You don't have any of it.

90
00:07:23,320 --> 00:07:28,720
So let's see what happens if my program have some kind of state also began seeing this do about it.

91
00:07:28,990 --> 00:07:36,250
So I'm replacing this semicolon and saving the program, and I'm again writing that computation statement

92
00:07:36,260 --> 00:07:39,730
over here, gebreselassie global Nazi people and pressing the end.

93
00:07:40,450 --> 00:07:42,960
So now you can see the exact error.

94
00:07:42,970 --> 00:07:48,890
I say there should be a semicolon after the end of the program, and here I didn't put the semicolon.

95
00:07:48,910 --> 00:07:53,600
So what happened the program through and error and the combination was failed.

96
00:07:53,890 --> 00:08:00,460
So in order to make this successful and flipping the semicolon again, saving the program again and

97
00:08:00,580 --> 00:08:08,230
running the completion call or the statement now it's compiled successfully.

98
00:08:09,470 --> 00:08:17,810
So after the competition, we will get an executable file in our system, so you can see over here there

99
00:08:17,810 --> 00:08:20,990
is a file created called in or out.

100
00:08:21,200 --> 00:08:23,720
We just not there previously.

101
00:08:24,020 --> 00:08:27,780
So this is that compiled at the site of that program.

102
00:08:28,640 --> 00:08:29,990
So this is the executable.

103
00:08:30,470 --> 00:08:32,600
No, you need to execute that program.

104
00:08:32,600 --> 00:08:35,210
So our program was created in CBP.

105
00:08:35,360 --> 00:08:42,200
We have compiled it and we have created an executable file, which computer can understand.

106
00:08:42,500 --> 00:08:49,640
So if I try to open this executable file in some kind of extended test, you will be getting the idea

107
00:08:49,820 --> 00:08:51,390
like what it will be looking like.

108
00:08:51,410 --> 00:08:56,930
So I will just open it in some sort of program.

109
00:08:57,710 --> 00:09:01,700
Let's go with the text editor and an opening that see here.

110
00:09:01,700 --> 00:09:04,490
We have a lot of things, but we don't understand anything.

111
00:09:04,910 --> 00:09:09,500
This means this is the actual compiled version of our program.

112
00:09:09,830 --> 00:09:15,320
It's not in that sense which we understand because it's something else.

113
00:09:15,320 --> 00:09:18,380
It's something understandable only to the computer.

114
00:09:18,380 --> 00:09:20,420
So we need not to worry about this.

115
00:09:20,630 --> 00:09:23,630
What we can do is like we can execute this file.

116
00:09:23,870 --> 00:09:30,360
So to execute this 8ot out, which is a result of my comp. Hello world, not CBB, I have a comment.

117
00:09:30,380 --> 00:09:32,060
Let's go to that comment.

118
00:09:32,390 --> 00:09:34,850
Dot slash here, dog.

119
00:09:35,630 --> 00:09:41,300
So my file name of the campaign file name is, you know, now and I am writing Dot Slash to execute

120
00:09:41,300 --> 00:09:42,770
backward and embarrassing.

121
00:09:42,770 --> 00:09:50,780
And so now you can see how older dog here, which is that the side of my program so you can see how

122
00:09:50,780 --> 00:09:59,510
many statements we have here in our particular programming language, C++ in order to just print Hello

123
00:09:59,510 --> 00:10:00,920
World and the council.

124
00:10:01,070 --> 00:10:07,940
So think about the large programs in the hour, the software's in the market or a play store, or even

125
00:10:07,940 --> 00:10:10,640
the system or the computer, which we use.

126
00:10:10,970 --> 00:10:16,910
How many lines it should probably have to create to such a complex program?

127
00:10:17,120 --> 00:10:17,420
Right.

128
00:10:17,600 --> 00:10:23,630
So that is one thing which you have to think, and this is how we execute C++ program.

129
00:10:24,680 --> 00:10:28,400
So pretty much in this module, we have covered our topics.

130
00:10:28,760 --> 00:10:33,020
We discussed the basic understanding of programming, what is programming?

131
00:10:33,500 --> 00:10:41,930
And we also discussed the peculiarities of programming languages, C++ and also we have seen how to

132
00:10:41,930 --> 00:10:46,490
write their basic C++ program, how to run or how to compile it.

133
00:10:46,760 --> 00:10:52,610
So I hope this year that you have understood pretty much everything, and I suppose you should have

134
00:10:52,820 --> 00:11:00,020
some confusions here and there because it should be there because this is just an introductory section

135
00:11:00,290 --> 00:11:06,590
and moving further, we will be learning much more about this programming language and we will be understanding

136
00:11:06,590 --> 00:11:12,680
why we will be using all these things and we will be understanding more concepts, which we discussed

137
00:11:12,680 --> 00:11:20,140
in just a small portion or like in a summary here in this unit, more in depth in comment on it.

138
00:11:20,150 --> 00:11:22,400
So you will be able to understand more things.
