volatile变量

编程入门 行业动态 更新时间:2024-10-26 17:22:19
本文介绍了volatile变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

哪里是存储在存储在程序存储器(其中部分)?

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

推荐答案

挥发性是的类型限定符不是存储类说明,所以也没有确定的存储位置在所有;它影响变量的类型,而不是它的存储的定义中。

volatile is a type qualifier not a storage class specifier, so it does not determine storage location at all; it affects the definition of a variable's type, not its storage.

它只是强制编译器明确地读一个变量,其的键入的是挥发性从变量的存储位置(可以是任何地方),而不是假设一些previously在例如寄存器读取值仍然有效。

It simply forces the compiler to explicitly read a variable whose type is volatile from the variable's storage location (wherever that may be) rather than assuming that some previously read value in a register for example remains valid.

更多推荐

volatile变量

本文发布于:2023-11-12 16:55:58,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1582027.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:变量   volatile

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!