0
我想轉換'unsigned char''uchar16'。起初,我直接轉換它,但它運行錯誤。opencl中的類型轉換
uchar16* out;
unsigned char ciphertext[16];
/*
*
*/
out[0] = (uchar16)(ciphertext[0], ciphertext[1], ciphertext[2], ciphertext[3],
ciphertext[4], ciphertext[5], ciphertext[6], ciphertext[7],
ciphertext[8], ciphertext[9], ciphertext[10], ciphertext[11],
ciphertext[12], ciphertext[13], ciphertext[14], ciphertext[15]);
當我使用實際值而不是變量時,它運行。
out[0] = (uchar16)(0x2B, 0x7E, 0x15, 0x16,
0x28, 0xAE, 0xD2, 0xA6,
0xAB, 0xF7, 0x15, 0x88,
0x09, 0xCF, 0x4F, 0x3C);
我在谷歌和Stackoverflow搜索,我沒有找到答案。
你沒有爲「out」分配任何內存。試試「uchar16 out [1];」代替。 – 2013-05-04 11:16:11