|
|
View previous topic :: View next topic |
Author |
Message |
david smith Guest
|
FYI: printing int32 undocumented |
Posted: Sun Apr 20, 2003 3:46 pm |
|
|
I want to keep a running total that may exceed 32k. CCS manual indicates a valid type of INT32 (4byte integer).
In a printf(), \%Lu is for 16bit unsigned.
As it turns out, it works for int32 signed and unsigned.
int32 count;
count = 79999;
printf("\%08Lu",count); OR
signed int32 count;
count = -85000;
printf("\%\%08Ld",count);
___________________________
This message was ported from CCS's old forum
Original Post ID: 13837 |
|
|
Kenny
Joined: 07 Sep 2003 Posts: 173 Location: Australia
|
Re: FYI: printing int32 undocumented |
Posted: Sun Apr 20, 2003 4:20 pm |
|
|
:=I want to keep a running total that may exceed 32k. CCS manual indicates a valid type of INT32 (4byte integer).
:=In a printf(), \%Lu is for 16bit unsigned.
:=As it turns out, it works for int32 signed and unsigned.
:=int32 count;
:=count = 79999;
:=printf("\%08Lu",count); OR
:=
:=signed int32 count;
:=count = -85000;
:=printf("\%\%08Ld",count);
Perhaps you have an early version of the manual.
It's in the manual I have dated September 2002, also in the one dated July 2001, and in the on screen help of IDE ver. 3.28 (PCM ver. 3.150):
"Longs in the printf may be 16 or 32 bit"
Regards
Kenny
___________________________
This message was ported from CCS's old forum
Original Post ID: 13839 |
|
|
david smith Guest
|
Re: FYI: printing int32 undocumented |
Posted: Sun Apr 20, 2003 10:30 pm |
|
|
:=Perhaps you have an early version of the manual.
Yup, mine's earlier, though the compiler is new.
Thanks.
___________________________
This message was ported from CCS's old forum
Original Post ID: 13852 |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|