no unsigned 32 bit numbers?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

no unsigned 32 bit numbers?

652 Views
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 Kudos
Reply
2 Replies

643 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mhjerde on Wed Jul 13 13:18:22 MST 2011
Thanks
0 Kudos
Reply

643 Views
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 Kudos
Reply