我在代码中发现了以下我不完全理解的语句:
UInt32 *pixels;
UInt32 *currentPixel = pixels;
UInt32 color = *currentPixel;
前两行对我来说很清楚,因为它们是 UInt32 对象、像素和 currentPixel 的定义。但老实说,后面的行对我来说没有意义。为什么不是:
UInt32 *color = currentPixel
但
UInt32 color = *currentPixel
那有什么区别呢?
如果我从 currentPixel 中删除 *,我会收到消息: Incompatible pointer to integer conversion initializing 'UInt32' (aka 'unsigned int') with an expression of type 'UInt32 *' (aka 'unsigned int *'); 取消引用 *
带 * 的取消引用是什么意思?
谢谢