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 right, welcome back, ladies and gentlemen, to a very important video about these exclusive tapes
that basically what I want to do, this video, is simply to give you this information that took me
so long to gather and organize.
It's sort of a cheat sheet that will help you to prepare for your next exam or interview or even like
to get yourself to a new level without getting lost with all of these constant definitions.
OK, so to be honest, it's quite not so trivial at first at least, you know, a lot of tutorials to
learn these differences between using constants and how they can be used with pointers and so on these
definitions, because the usage of constants, the syntax in some constellations is very and I mean
very difficult to understand.
So I've done this video to make this life much easier for you and to understand everything from a hopefully
to Y or Z.
So let's get started.
OK, and the first thing that I want to talk about is the default usage of constants in C language.
This refers to the default usage of constants and basically it is the same.
OK, if you've written just const age equals to you 35.
OK, so if you've written it this way.
OK, so it simply assumes that you've written and created a variable of an integer type unless of course
otherwise was specified.
So if you will see some exercises or in some solutions or basically in some examples, just const age
without seeing that type itself.
So you can assume that that's the default usage of constants in C and behind the scenes.
It's just like it was written const and age equals 35.
And basically what was created here is just the variable of of simply an integer type, which is constant
and it cannot be changed over time.
Awesome.
So write down this note also for yourself and let's proceed to the second option.
The second option goes like this const and star BTR.
OK, so what we do here is we create a pointer to a constant.
OK, so a pointer to a constant with me droid maybe a little bit one sec.
But Bob, let's go like this.
The pan.
What's going on.
Oops.
What's happening.
OK, so there is the Bam.
So we created a variable called BTR and this variable is assumed to point to some value to some other
place in memory.
Right.
Since it's a pointer and these value that we should point to.
Could not be changed through these point.
What do I mean by that?
So we have a pointer to some constant that is of an integer type and any attempt to change or to modify
the content of the place we are pointing to will result in a compilation error.
So make sure you understand the pointer itself is not a constant.
OK, these pointer is not a constant.
What is a pointer?
It holds the address of some or some other data in memory.
OK, maybe like I don't know, four thousand.
OK, the address.
So the pointer itself, the highest value of BTR, it may change.
OK, it may one time point to here and one time point to there.
OK, there is no problem that these value will be changed to three thousand for example.
But there is no basically problem with that.
But the place or the constant integer we are pointing to cannot be changed.
So something like that.
Awesome.
So now let us see an example that may also make things a little bit easier for us.
So an example.
Here we go.
OK, so let's start and start and start Bidya const BTR equals the address of age.
So simply here we created a constant pointer that points to a variable called H.
OK, and now we try to modify the value of age where we point to and not the actual pointer.
Right.
We do not point.
We do not change the value of PGR itself.
We try to change the value of where we are pointing to.
And if we go back, we can see that this declaration of Ayinde Star const PGR in star const BTR is basically
OK.
It allows us to modify the value where we point to OK, not the actual pointer.
So there is no problem in that.
But we said that if we will try to modify the BTR value itself, the value of the variable itself,
the value of the pointer itself, that's basically will result in a compilation error.
OK, so I hope that's clear.
And it basically concludes the first three options that we've just seen.
And yeah, awesome.
So let's proceed with the last one.
I think basically it will be clearer to you.
OK, so that's the last one.
The fourth where it is.
So here it is.
Here it is.
How we create a const and star const BTR.
So basically we create a constant pointer pointing to constant integer.
OK.
That's a combination of the previous both constants right here and basically we have our appointer constant
pointer pointing to a constant integer, nothing can be changed.
Neither the pointer nor Warith points to, OK.
So basically, you if we created some PDR to point to numb, then neither of them can be change, nor
this one that BTR itself, neither the variable or the constant value where pointing to.
OK.
So basically these steps are really important because a lot of times people and my students and also
I know that other students do they find really difficult to understand.
What is the difference between this one and why do I have problems when I'm using this one?
And what is that one?
So now I think everything is clear to you guys and you are basically ready to proceed.
You are basically ready to move on.
And yeah.
So I think we've covered it up.
The top uses are used cases with constants and pointers.
And make sure you write down these notes because that's superimportant.
Run some examples on your own and make sure that everything said here you understand as well as make
some tests to make sure that everything I said is correct.
OK, so check check it out and until next time.
Thank you so much for watching.
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.