CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug Reports on this forum. Send them to support@ccsinfo.com

printf and int32

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Ringo42
Guest







printf and int32
PostPosted: Fri Jan 17, 2003 9:17 am     Reply with quote

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
PostPosted: Fri Jan 17, 2003 9:20 am     Reply with quote

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
PostPosted: Fri Jan 17, 2003 9:26 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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