View previous topic :: View next topic |
Author |
Message |
Ringo42 Guest
|
printf and int32 |
Posted: Fri Jan 17, 2003 9:17 am |
|
|
How do you use printf when printing signed int32's?
I know \%ld is for longs, but what about signed 32 bit numbers?
Thanks
Ringo
___________________________
This message was ported from CCS's old forum
Original Post ID: 10754 |
|
|
Hans Wedemeyer Guest
|
Re: printf and int32 |
Posted: Fri Jan 17, 2003 9:20 am |
|
|
Same thing \%ld
int32 Val = 123456;
printf("Val=\%ld",Val);
output 123456
Val = 123;
printf("Val=\%06ld",Val);
output 000123
:=How do you use printf when printing signed int32's?
:=I know \%ld is for longs, but what about signed 32 bit numbers?
:=Thanks
:=Ringo
___________________________
This message was ported from CCS's old forum
Original Post ID: 10755 |
|
|
Ringo42 Guest
|
Re: printf and int32 |
Posted: Fri Jan 17, 2003 9:26 am |
|
|
Thanks, I just wanted to make sure there was not another way I should be doing it.
Thanks
Ringo
:=Same thing \%ld
:=int32 Val = 123456;
:=printf("Val=\%ld",Val);
:=
:=output 123456
:=
:=Val = 123;
:=printf("Val=\%06ld",Val);
:=
:=output 000123
:=
:=
:=
:=:=How do you use printf when printing signed int32's?
:=:=I know \%ld is for longs, but what about signed 32 bit numbers?
:=:=Thanks
:=:=Ringo
___________________________
This message was ported from CCS's old forum
Original Post ID: 10756 |
|
|
|