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 CCS Technical Support

[Help] Printf strange behaviour: don't plot zero value

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



Joined: 11 Mar 2010
Posts: 19540

View user's profile Send private message

PostPosted: Sat Aug 03, 2013 12:54 am     Reply with quote

I'd suspect the version might be quite early. PCD, had some printf problems in the past with 32bit integers, around the low 4.100's.
It gives the correct answer in 4.107, but is faulty in 4.099.
It will though work correctly, if you specify a field width. Just use:

printf("%1Ld,",temp);

Basically with a zero value, it displays nothing, rather than the zero. Specifying a single character minimum field width forces it to output one character in this situation, and the zero is then displayed.

Best Wishes
CoverUp



Joined: 04 May 2010
Posts: 7

View user's profile Send private message

PostPosted: Wed Aug 07, 2013 9:15 am     Reply with quote

Our version is CCS 4.104

i tried with

Code:

printf("%1Ld,",temp);


The output is

Code:

100,50, ,10
100,50, ,10
100,50, ,10
100,50, ,10
...etc.


So "nothing" is replaced by "space". So you guys are right, it's a PCD bug and we need to update.
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