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.
ピクセル値を16進形式で読み取る次のコードスニペットがあります。
Uint32* MyPixel = pixels + ( (iH-1) + image->w ) + iW; printf("\npixelvalue is is : %x",*MyPixel);
新しい 16 進数値を *MyPixel に再割り当てするにはどうすればよいですか?
*MyPixel = "00FF00";
"00FF00"文字列リテラルです。16 進整数リテラルが必要です。
"00FF00"
*MyPixel = 0x00FF00;
Prefix0xは、残りの数値リテラルを 16 進数の数値定数として解釈する必要があることをコンパイラに伝えます。
0x