gpt4 book ai didi

c - 使数组内容易变的正确语法?

转载 作者:太空宇宙 更新时间:2023-11-04 06:33:02 25 4
gpt4 key购买 nike

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

volatile short Array[];

short volatile Array[3];

最佳答案

两者都行。这是两者之间的区别

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

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

这很重要。

const 的行为方式相同。

关于c - 使数组内容易变的正确语法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18615596/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com