0

我依稀记得关键字的顺序volatile会影响您希望指向数组的指针是易失性的还是内容本身。如果我希望内容不稳定,是否需要编写:

volatile short Array[];

或者

short volatile Array[3];
4

2 回答 2

3

要么都行。这是之间的区别

short volatile * ptr; /* pointer to volatile short */

short * volatile ptr; /* volatile pointer to short */

这很重要。

const行为方式相同。

于 2013-09-04T13:47:25.887 回答
0

它们都可以正常工作。说明符的顺序无关紧要。
阅读这个答案以获得更详细的解释。

于 2013-09-04T13:47:33.490 回答