2006-09-07 03:22 AM
2006-09-06 07:02 AM
Hi.
I have a small problem with GCC Arm Compiler, below is my test code. unsigned char buf[50]; unsigned short int w; memset(buf, 0, 50); buf[0x0A] = 0x30; buf[0x0B] = 0x00; buf[0x0C] = 0x02; buf[0x0D] = 0x08; w = *(unsigned short int *)&buf[0x0B]; In this place I expect that ''w'' variable have value 512 (0x0200 hex) when i printf(''w = %u\r\n'', w); on my console is ''w = 805306368'' in hex is 0x30000000 Whera that value in w variable ? And how I to get correct value in ''w'' variable ?