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?
And welcome to this amazing section about files in our programming language.
So what I want us to understand before we dive into files is basically that using files as part of your
development process is pretty much necessary in most of the things that you are going to work with.
You're probably going to work with files and whether these will be done using your programming language,
for example, C, C++ or even Python.
So basically by learning the concepts of using files, even here in these course, you will be able
to implement them.
This knowledge also in other spheres, in other programming languages as well.
So pay close attention because that's a very important topic.
But before we move on and understand how the files work, I would like us to give it a little time,
about two or three minutes, and to talk about what have we learned so far.
So up until now, we've learned how to create different variables, how to use different loops.
We've also talked about functions and so on and so forth.
Right.
And in all of these steps or sections, we could have seen our program being run.
But once it was completed, once the execution was finished, the program finished its execution process.
We actually didn't get any chance to see something written anywhere except just this nice black console
that we had.
Right.
Where is it?
This black console and least console application is nice, but let me show you, for example, so here
were our results so far.
So up to this point, the only thing we knew how to do regarding printing the output somewhere, it
was just displaying the output here on these nice little screen.
But suppose that, for example, you have to write a program that prints all the numbers from one up
to 50 and next to each number, you have to print the square of this particular number.
So how would you do it so far?
Right.
We could have done it, let's say something like this.
So let's say I and then specify for I equals to one.
As long as I'm less than 50.
Let's go with C++ and just use something like this.
So print half the value of the number I and the value of the number multiplied by itself.
So I and I multiplied by I.
OK, so in this case, if we would run it, basically everything would be printed to the screen and
you could see something like this.
Right.
So two multiplied by two is four, three is nine and so on and so forth.
Right.
But the main question here is, let's say that sometime in the future, you would like to see these
results that you've calculated, although here is a very a very simple example.
But let's say that later on you would like to see these results once again.
OK, I don't know, maybe maybe think of it as a situation where you are going to write some amazing
program that does a lot of research for some topic, I don't know, biology or something like that.
And then your program should calculate the result and come to some conclusions.
For example, let's say that a program can tell you or say your program will predict what will be the
weather outside from this day up to, let's say, 7000 years from now.
OK, pretty cool program, but you've written this program, you run it, you wait a couple of hours
to get the results done right.
Because your program is not just two lines and then the results are being printed to the screen, just
like we've done it right here.
So you see the result and then you come the next day.
You recall that there is a vacation that you are planning to do next week, but you don't know what
will be the weather.
So what do you have to do is basically run this program once again, wait for the results and then compare
it again.
But the results are basically expected to be the same.
So it would have been.
Much better if we could take all of these results printed to these council application and basically
to redirect this output stream, let's call it for now, like output stream of data being moved to the
council application instead of making this process.
We what we would like to do is to take all of these data and to put it in some file that will be stored
for later on usage.
OK, so let's say some textual file that we will be able to take this information to put it there and
it will say and it will be stored, let's say, on our hard drive.
OK.
So that these weigh the printed result will still be on your computer, even after you close the program
and even after you will restart your computer.
OK, so now every time you would want to see the results that you've already devoted your time in to
calculate them, you will simply open up this file without the need to wait until the calculations will
be done once again and basically work with the data, look at it and do whatever you like, OK?
Pretty awesome, isn't it?
So there are also additional reasons for that.
But one of them, a very useful reason, will be discussed in the following videos.
But not all of them, of course, because we still need to sometime for the Syntex and for the actual
technical stuff.
But we will get also additional details, additional examples.
So this is very important.
Guys, don't you dare falling asleep.
I'll see you in the next videos.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.