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 righty, so I've organized a little bit the code that we had previously with all the steps and everything,
and I just organized that a little bit more nice looking and ready for the usage and learning process
of the functions that we are going to learn.
And the first function is F get C.
So these function works in the say in the following way.
It receives just one argument, which is a pointer to a file.
OK, probably is going to be like these F.P. a pointer to a file that has probably been opened for reading,
just like we have here.
And all these efforts, the function is going to do the F getz's basically an abbreviation of file get
character, all it's going to do is to take one character after them, after the other.
OK, one character, the second one, and so on and so forth from these file that has been opened using
the pointer.
So if we would like to demonstrate how it's going to look like.
So let's create I don't know Char, let's create a variable char.
Let's call each char mycar one and now we'll open up the file using the PHP pointer.
We will make sure that the file was successfully opened.
Otherwise there is no need to do anything.
And now we are going to use like my char, my char one equals to f getsy.
OK, you can see that the compiler, the compiler, our ID recognizes it and basically because we included
the standard input output.
So f get, see and hear, it specifies what type of argument it expects to receive.
So a pointer to file.
We know that FP is a pointer to file, so let's send their F.P..
OK, and I'm talking about this file that I have right here.
Where is it.
Where is it.
Here it is, my first file.
It has the following text of hello.
All right.
Awesome, so let's close it, let's close it.
Come on, come on, come on.
OK, and now once we are going to read from these file, these character, we would like also to see
what we've read.
Right.
So let's go like print F our standard print F to print the value to the screen.
So let's go.
Like the character, the character that was read is let's go percentage C and backslash and basically
that's it.
Right.
And here we will specify my char one.
My char one.
Awesome, so let's try to build and run it and see what this program will give us.
What do you expect to see guys think about it before you read it?
You expect to see a capital H and there you go.
The character that was read is Capital H.
So we've read the first character from this file.
And if we would like to read another character, let's simply copy this one.
OK, so let's copy this one and based it right here.
So my third one, the first let's make it the first character and the second character and basically
build and run it once again and see what it gives us.
So there you go, h e and basically we have the first character, the second character.
And if you would have used maybe in your future exercises some loop here, then you will go and every
time you will that every time that you will read a character from these file, you will also advance
your PHP pointer to point to some relevant character that it has not read yet.
OK, for example.
So what I want you to know is that these pointer to file these file structure is very, very kind of
smart.
OK, it knows if it has read one character to move to the next one.
And we will also see different functions that will allow us to move further and to move back on this
stream of bytes.
We said that file is a stream of bytes, right.
So we can move from one side to another and read whatever we need.
So I hope that's clear.
So far, OK, guys, let me know if you have any questions regarding the F Getsy function.
And before we will finish, we just we kind of important note.
We remember that we talked about Ezzedine, right.
Which is just the standard pointer to the keyboard standard or the important, just a pointer to the
keyboard.
And if we wanted to read information from the keyboard, we probably used these SDD pointer.
Right.
And we know that F Getsy reads a character from the pointer we supplied with.
So in this case it was like a B, which is a pointer to a certain file.
OK, but in our case, this is the case where we have these pointer to a file.
But also we could have used the F Getsy function, this function and pass to it the Usted and as a pointer.
So it will basically look like this.
Let's get it here.
So f getsy in here specify instead of the pointer, which is a pointer to this.
My first file, the file.
So FRSC and specify here SDD input.
OK, so you see it recognizes also the screen and this way you will read one character from the keyboard.
OK, so it will look something like this.
Let's go like this.
OK, so you see the console waits for your character.
So let's go like OK, a presenter and then.
The program continues, so FRSC is very general, and once you you do understand what is this Ezzedine
standard input pointer?
So we can say that F-16 is equivalent to get kind of equivalent to get chaar that you've used probably
in one of your previous sections when you were study to read a character from the user or better say
from the keyboard, from Ezzedine pointing to the keyboard.
So, yeah, this is for these video guys.
Thank you so much for watching.
Keep on practicing.
This is the first function related to working with textual files.
Very important to understand that you will have some exercises, hopefully will add some good ones and
until next time, have a great time.
My name is Vlad Alphatech.
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.