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 in this solution, I will basically take the previous development that we had and I will just modify
it a little bit, OK?
So instead of count of characters, let's say new lines, new lines equals to let's say one word, let's
call it total lines, total lines in a file, we will initialize it to one.
And so what do we have?
We have a file and we want to know how many lines this file has or better say we can say how many new
line characters these file has.
OK, so we will keep up with our previous suggestion to read a character at the time.
And as long as we do so, we will ask if a given character equals to what?
What do you think is the indicator for working with new lines?
What specifies a new line?
You're right, it's the backslash in character.
So if we read from the file a backslash in character, then in this case what we should do, we should
say total lines plus plus.
Oops, I'm here.
So incrementing total lines by one, if we found out that we have a character that equals to backslash
Lashan because as we also already said at the end of each line here, although we cannot see a specific
and explicit backslash end.
But there is we also saw it in the previous video that we worked with, counting the characters.
You've seen that the backslash was there.
So there is a backslash in here.
So whenever we would see a solution, we get to a new line.
So that's what we want to count the number of times we've encountered the backslash and character.
All right, so then we will say the total number.
The total number of lines in these file.
Is.
What is the total number of lines in this file that we specified total lines.
That's eight guys, so build and run it.
Let's see that it works exactly as we expected.
The total number of lines in these file.
Three, we can also modify it.
I don't know.
Let's copy and paste.
And they had a new line, Lolla, and see that now we have like seven lines.
Let's see that it supports also they separate.
So the total number of lines in this file is seven.
Awesome.
Congratulations.
Good job, guys.
So, yeah.
We will move on.
Good luck.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.