unsigned int PointSet[] = { (10<<16) | 3, (4<<16) | 2, 0xFFFF0002 };
What does this mean ?
| 3
what operation is it?
unsigned int PointSet[] = { (10<<16) | 3, (4<<16) | 2, 0xFFFF0002 };
What does this mean ?
| 3
what operation is it?
This creates an array of three integers. The commas separate the constant-value expressions. The | is bitwise OR operator.
(10<<16)|3 = (0xA<<16)|3 = (0x000A0000)|0x3 = 0x000A0003
(4<<16)|2 = (0x00040000)|0x2 = 0x00040002
Your array is { 0x000A0003, 0x00040002, 0xFFFF0002 }
unsigned int PointSet[] = { (10<<16) | 3, (4<<16) | 2, 0xFFFF0002 };
10 = 0000 0000 0000 0000 0000 0000 0000 1010 (Binary)
0x0000000A = 0 0 0 0 0 0 0 A
0000 0000 0000 1010 0000 0000 0000 0000 (16 bit shift)
0x000A0000 = 0 0 0 A 0 0 0 0
3 = 0000 0000 0000 0000 0000 0000 0000 0011
0x000A0003 = 0000 0000 0000 1010 0000 0000 0000 0011 (... | 3)
0x00000004 = 0000 0000 0000 0000 0000 0000 0000 0100
0x00040000 = 0000 0000 0000 0100 0000 0000 0000 0000 (16 bit shift)
0x00000002 = 0000 0000 0000 0000 0000 0000 0000 0010
0x00040002 = 0000 0000 0000 0100 0000 0000 0000 0010 (... | 2)
unsigned int PointSet[] = {0x000A0003, 0x00040002,0xFFFF0002};