filmov
tv
const with volatile in c programming language #2 | by dubebox #shorts

Показать описание
const with volatile in c programming language
To access hardware registers. Here, we need to take a pointer , which should be constant , and its value could be changed by hardware as well.
Let me assigned this as a constant pointer, star const.
And, as the value has to be changed unexpectedly, using volatile keyword.
And, finally assigning hardware address to it.
Now, this pointer reference can never be changed, and its value could be changed by hardware , so that the program will always get the updated value.
Here, status will be fetch the updated value
To access hardware registers. Here, we need to take a pointer , which should be constant , and its value could be changed by hardware as well.
Let me assigned this as a constant pointer, star const.
And, as the value has to be changed unexpectedly, using volatile keyword.
And, finally assigning hardware address to it.
Now, this pointer reference can never be changed, and its value could be changed by hardware , so that the program will always get the updated value.
Here, status will be fetch the updated value