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
What is going on, guys, so in one of our previous challenges and practices, I've shown you this example
of how you can run some code.
And also in the previous video where we talked about typedef structures, I've shown you two examples
of using the print date function, as well as using the date input date function in.
Just a quick reminder to you, if you were not concentrated and that's very important, that you will
be concentrated and each the material every second of the course, because if you miss one thing, it's
it will be very hard to, like, fill these gap and to proceed and move on with the more more advanced
material.
So what we have done previously is that we use the time definitions, truck, date, day, date.
And we know that now every time that we are going to use the word date, it is just equivalent as we
have been using previously structured date.
So we created the structure.
Then we wrote down the print date function.
That's the name.
That's the type receiving a date D.T. and printing out the year, the month and a date values.
And also we have the second functionality responsible for all of the operations we've done here, using
the second half in print F and so on.
And the reason why the reason why we took and like, you know, you split it out the code of all of
these part to these function to date and also all of these code to the print date is because we want
to leave our main function as clean as possible and to separate the functions that are going to be like,
you know, repetitive functions to different functions.
So, for example, you know that you will use print date probably more than just once, OK?
And probably more than just for one date variable as well as you're probably also going to create more
than just one date variable in your program, in your code.
So this will be a function that is responsible for everything instead of having everything in the main
and just duplicate and duplicating the code and messing everything up.
OK, so once it's clear why we've done it and make sure you watch the previous videos, because I'm
not going step by step on these two functions, I'm going to proceed and to make some use in the main
function that will take both are will take, will utilize and take advantage of these two functions
that we just created the date and the print date.
So first of all, let's create our new date, let's say date, graduation, graduation, date.
And we just created a variable and it's not initialized.
None of its fields are initialized.
And one way to do so is to use graduate date.
Graduation date equals to input date.
And basically what will happen here is that once we reach this line, we will simply call this function
in to date.
And it is in charge of creating everything, four of these for the structure, reading the values from
the user and returning the result.
And once the result is returned, instead of using these complex print f, we will simply use print
date and specify what we want to print the graduation date.
And there you go.
So what will happen now is that if we build and run it, we will see enter a date five, six and 2021
and there you go.
You have the year, the month and the day.
Everything is working exactly as we expected.
And if for some reason you also want I don't know, like like I don't know the date of today, for example,
OK, the date today date.
So you create two variables.
OK, the first one is graduation day.
The second one is today date.
Instead of duplicating code.
What do you simply do is today date today date equals to date once again, input, input, being put,
input, date.
And if you want to printed you simply print date.
And you specify here that today date.
There you go.
See how clean the main function remains in how we utilize and take advantage of both of these functions
that we've just created, simple as their guys, instead of putting everything like, you know, like
putting all of these code for the graduation date here.
And instead of putting everything for the today date here, we simply use this function as separate
units and we work with them correctly.
So I hope.
That's clear.
That's, I think, good enough for the basics of structures, understanding how to work with them,
how to function, work with structures, accessing, reading, printing and so on.
So thank you guys for watching.
And let's move on.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.