no unsigned 32 bit numbers?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

no unsigned 32 bit numbers?

648 次查看
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 回复数

639 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mhjerde on Wed Jul 13 13:18:22 MST 2011
Thanks
0 项奖励
回复

639 次查看
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 项奖励
回复