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
So welcome back.
And now basically what we would like to do in this solution is simply given this text file, OK, we
would like to read it and the way we are going to read it is using the F Getsy function to basically
read character by character until we reach the end of the file.
OK, so how will it look like we will create a pointer called FP, a pointer to file and we will use
FP equals to f open reading these file then we will ask FFP does not equal to now.
Then it means that the file was successfully opened.
What would we like to do here?
What do you think?
If we use just one f getsy then probably what we are going to get is just one character.
So we use Algazi, specify the pointer and let's create also additional variable to store our characters.
So let's say Char Maija.
We will say it like this, Maija equals to f getsy F.P..
So this will read the first character, but that's not something that we want.
We want to basically on every iteration to read a character until some condition is met.
And what is this condition?
This condition is until we reach the end of the file.
So how can we specified?
Let's let me show you.
So while while and we will say until we don't reach some condition, which is the end of file and we
have these special EAF and a file specifying we reached the end of the file.
So that's basically also take these Maija inside of these while statement.
Don't don't get scared.
It's not so complicated.
So let's go like this.
Let me explain you in just a second what we've done here.
OK, no worries, guys.
So.
What do we have here?
We have my car getting assignment and input from F. Getsy F.P., getting a character from the file one
after the other and deles while until you reach the end of the file, that's it.
Read a character from a file until you reach the end of the file.
And on every iteration, what I want you to do is to print the character to the screen.
So my char.
My char.
And that's basically all there is to it.
OK, just we need to add the count, but I want to first of all, to run this program to show you that
it works.
OK, so hi, this is Vlad from Alphatech.
And what can you notice here?
You can notice that my getting character one at a time, it also gets characters like H e y and then
he gets characters like space and then it also gets characters like Backslash N.
Because if it wouldn't get the backslash and characters, the new line characters, then what would
happen here is that all of the text from the file would be just in one line.
And you can see that by using these print F percentage C and the backslash.
And right here we jump to the next line, to the next line and so on and so forth.
So the backslash was read carefully.
And finally, I also wanted to create some counter.
So end count of characters equals to zero.
And in this case, every character we are going to count, it's a complex place.
And finally, we will print.
I don't know, the total of characters in the file.
In the file is percentage, the backslash in percentage.
They will be replaced by count of characters.
And that's it.
So let's run it and hope for the best, so, OK, here, we also need to get a better solution, right?
Because at the end of the file, there is no backslash and it ends on just one line.
So it will look like there's no here.
Come here.
There are a lot of characters in the file is 32 and if you will count them up, they should match,
including the backslash and probably.
Right.
So, yeah, this is it for this video.
Guys, thank you so much for watching.
Keep on practicing.
Keep on moving forward and you are bound to succeed until next time.
My name is Vlad.
I'll see you then.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.