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

printf format

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



Joined: 17 Oct 2005
Posts: 116

View user's profile Send private message

printf format
PostPosted: Sun Dec 11, 2005 10:54 am     Reply with quote

I would have expected the following code to give me a 101.34 with a value of 10134. What I get is 101.02ld. What am I doing wrong? Compiler vers. is 3.239.

Code:
printf("\r\ngravity = %03ld.%02ld",value/100, value%100);


thanks....Harry
Harry Mueller



Joined: 17 Oct 2005
Posts: 116

View user's profile Send private message

PostPosted: Sun Dec 11, 2005 11:27 am     Reply with quote

I just recompiled the program and it now works. Go figure!
Harry Mueller



Joined: 17 Oct 2005
Posts: 116

View user's profile Send private message

PostPosted: Sun Dec 11, 2005 12:41 pm     Reply with quote

False alarm...just figured out my problem. Embarassed

I'm not sure why, but as soon as I post a question my thinking gets clearer. Sorry for bothering you guys.

Harry
Ttelmah
Guest







PostPosted: Mon Dec 12, 2005 6:01 am     Reply with quote

I think most of us were having a weekend off anyway!. :-)
However it is the act of 'verbalising' the problem (though in writing, rather than orally), that often helps with a solution. Describing it to a brick wall/plant/office cat, sometimes works as well, but can lead to people thinking you are having a different type of problem.....

Best Wishes
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