Volatile variable

前端 未结 6 1519
梦谈多话
梦谈多话 2020-12-25 15:12

Where is a volatile variable stored in the program memory(in which section) ?

6条回答
  •  無奈伤痛
    2020-12-25 15:37

    There's no reason for a volatile variable to be stored in any "special" section of memory. It is normally stored together with any other variables, including non-volatile ones. If some compiler decides to store volatile variables in some special section of memory - there's nothing to prevent it from doing so. But at the language level there's absolutely no reason for this.

    Why are you asking such a question? What made you think that it should be stored in some special section of memory?

提交回复
热议问题