Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有以下代码片段,它以十六进制格式读取像素值。
Uint32* MyPixel = pixels + ( (iH-1) + image->w ) + iW; printf("\npixelvalue is is : %x",*MyPixel);
如何将新的十六进制值重新分配到 *MyPixel 因为我试过这不起作用。
*MyPixel = "00FF00";
"00FF00"是一个字符串文字。您需要一个十六进制整数文字:
"00FF00"
*MyPixel = 0x00FF00;
前缀0x告诉编译器需要将数字文字的其余部分解释为数字十六进制常量。
0x