Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
All right, welcome back, guys.
So in this video, we are going through, right?
Simple example, a simple example for a function in C programming language.
So these functions should basically be some reading function that only does the Toli does.
It's just a reading function, reading function that all he does is simply running some print F commands.
And this function.
All he does is simply to to do what's to, let's say, printing.
Hello.
This will be printed out on the first line.
And the second line we will have.
Welcome to the best course ever.
Right ever in C programming.
Programming language.
This will be the second line.
And on the third line, our function will bring something like a good luck message.
All right.
So all these function will do is simply to run, to execute, to print on the screen.
These three lines of information.
So the function is going to be with no parameters.
It will not get.
It will not expect to receive any parameters.
And it will not return anything.
It will simply be like a guy that you just call him.
You don't pass him anything.
And also, you do not expect to receive anything in return.
You simply call him.
And all he does is to print something to the screen.
And you know that once this guy is over with his task, that, you know, its task is simply to bring
something to your screen.
What once he's done with these tasks.
You can move on to the next commands.
So let's see how our signature for this function will look like.
All right.
So first of all, we know that this function will not return anything.
So the type of the function we said previously is going to be of not an integer, not a double, not
a double, not a char or nothing like that.
The type of the function is going to be specified as Avoid the Void says that we will not expect to
receive anything in return are once the function has been.
As it has ran all of its commands.
And then we are going to to specify the function name.
So we will go like preened.
Let's go.
Preened readings.
Right.
Print reading.
Let's say print greetings.
Bring greetings.
All right.
So this is the functions name.
This is what.
The function.
The function.
Stipe and this is the function name.
And now we know that the function will not expect to get any parameters.
So we'll just use empty parentheses here.
And we will not specify anything in this.
Are borage so far or signature?
So now what we've created is a simple function that for now it does not has anything.
It does not contain anything.
And what we would like to do next.
This is specified the function body.
So it will go with these curly brackets.
And now everything that is going to be between these curly brackets is going to be a part of these preening
print greetings function.
So we are going to specify the first print of command.
So it's just like hello.
And a backslash.
And at the end, although we could just use all of these attacks to print it out in just one print of
command by specifying that the correct places the backslash and we are going to divided the three print
of command commands.
So it will be just more nice for us to see.
So for the second print F line, we are going to use Spring Springtown and we are going let's just copy
and paste this line, going to base it here.
So backslash n at the end, semicolon.
And there you go.
So now now we are going to use also the third line, which is just a print half good, large message.
The last message.
And that's it.
This should be like this.
It looks nice, right?
And now what I want us to do is to understand what we can see here.
So once again, what we've done right now, we didn't run these function.
We just created a template of a function.
We just created the function itself.
It's not being run.
If we just if if we even build and run this program right now, these messages are not going to be seen
on your screen.
So you may even try it.
Let's do it.
Let's go.
Like we're running it.
And you can see that nothing nothing happens, right?
Because we run the INS.
Me.
This is the entry point.
We run this command, return zero.
We actually do not do anything here in this main function.
And that's it.
So we simply created some guy.
Let's say that he his name is print greetings and he does not expect to receive anything.
No parameter is specified.
And we will call him, we will not expect that he will return something.
But all he all he does is simply to run these three print F comments, to print some information to
the screen.
And what interests us here.
Right.
We we created this function.
We want to call this function.
Want to rohn's these functions somehow.
So for that, we're going to come back here at the end main function and we know that we can call every
function by its name.
Right.
And the name is print.
Greetings.
So let's try to write down print.
Greetings.
Print greetings.
Write print.
Greetings.
And we specify VMT parenthesis here and just semicolon at the end.
So let's see what happens in this kit.
In this case, let's build and run it.
Oh.
And there you go.
You can see that all of the message was printed on the screen.
The Hello, the welcome to the best chorusing C programming language.
And a good luck message.
So basically all the information of these function was printed out.
So let's see what happened here.
We, first of all, came to the entry point to the main.
Then we started to execute the there these function body.
Right.
The first command and then the second and the third one and so on.
So when we when we saw these print greetings, we know that you can see it in the red, that once you
write the functions name, you are going to execute this function.
We know that the function does not expect to receive any parameters.
So we do not send to these function any arguments.
Right.
You send arguments and the function receive it as the parameters and also the function does not return
anything.
So we just called the function.
We say, hey, print greetings guy, do your job and print everything to the screen.
And there you go.
So this is this command is the first one to be executed.
And then you go like this.
You print these line.
Then this line.
Then this line.
Then you come for the next to the last line in this function.
And once the function is done, running all of its commands, you are going to come back here, here,
and you are going to proceed with this function.
All right.
Within my next line with line number 19.
And very you go you basically will the return zero in your program is overeats complete.
So I hope this makes sounds how you create a function function of type void that does not supposed to
return anything.
No parameters.
You call this function here and basically let's listen and see.
Let's add another align.
Let's say pretend to have an.
Hello.
Let's say hello to this program.
I'm writing from from main function.
Okay.
So this message is going to be printed out from the main function.
And once it's printed out, we are going to call these function or print readings function.
All of its commands are going to be executed.
And then we are going to come back here and say, let's say just just that you will see the difference
in how the flow goes.
Now, I am after the function.
Also at main.
Also at Main.
Okay.
And we will add a backslash and the and the semicolon at the end.
So now if we build and run it, let's see what happens.
All right.
Oh, we have the message here.
Why.
What is the problem?
I got a semicolon in the end.
Don't forget a semicolon.
Otherwise, bad things may happen.
So let's run it.
And there you go.
You can see that the first message is hello, this hello to this program.
I'm writing from main function.
And once in these messages printed out all the functional body of the print.
Greetings.
I am of the print greetings.
Function is being executed.
And then we have it was like one, two and good luck.
Oh, I didn't specify backslash and at this function.
Let me see.
Let me check out.
There you go.
You should also specify because Lashan and once these functions is over, we are going to proceed with
this line after all of these lines were printed out on the screen.
Who so this this was not so easy.
But I think you've got the idea we create a function and then we can call this function.
So this is it, for example, number one.
And let us proceed with the second example.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.