What is volatine in C

Asked

Viewed 37 times

0

I’m reading this booklet (http://www.inf.ufpr.br/lesoliveira/download/c-completo-total.pdf) and came across the modifier volatile. I don’t quite understand how it works, so my question is:

  • What it’s used for?
  • Where can I use it?
  • Does it have anything to do with const?
  • What happens if I use const and volatine together?

The booklet says:

For example, an address of a global variable can be passed to the clock routine of the opercaional system and used to store the system real time. In this situation, the contents of the variable is changed without any explicit attribution command in the program.

Right after:

The volatile modifier prevents these changes from occurring

So it means that if I put volatile it would be that no further changes will occur in that given ending?

Page: 42

  • Would you kindly tell me which page this is written on?

  • I will make the amendment to the question.

  • Thank you, I’ll close the question.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.