no unsigned 32 bit numbers?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

no unsigned 32 bit numbers?

650件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mhjerde on Wed Jul 13 12:50:00 MST 2011
uint8_t a;
a = 10 * -1;
printf("%d \n", a);// prints 246

uint16_t b;
b = 10 * -1;
printf("%d \n", b);// prints 65526

uint32_t c;
c = 10 * -1;
printf("%d\n", c);// prints -10


The above suggests that there is no unsigned 32 bit int available? I'm using the LPC1768. Sorry about the weird example code.
0 件の賞賛
返信
2 返答(返信)

641件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mhjerde on Wed Jul 13 13:18:22 MST 2011
Thanks
0 件の賞賛
返信

641件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed Jul 13 12:55:28 MST 2011
What about %u :eek:

http://www.cplusplus.com/reference/clibrary/cstdio/printf/
0 件の賞賛
返信