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

Search found 2 matches
CCS Forum Index
Author Message
  Topic: Using printf to output hexadecimal
pl7

Replies: 5
Views: 12309

PostForum: General CCS C Discussion   Posted: Thu Apr 30, 2009 9:30 am   Subject: Using printf to output hexadecimal
Use standard a format string (%x seems to default to %02x):
printf("%1x", a);

This was my first thought too, but the width part of the format string specifies a minimum number of digits, ...
  Topic: Using printf to output hexadecimal
pl7

Replies: 5
Views: 12309

PostForum: General CCS C Discussion   Posted: Thu Apr 30, 2009 7:55 am   Subject: Using printf to output hexadecimal
Hi,

An easy question, I hope. I'm puzzled by the behaviour of printf on a PIC 18F452.


int8 a;

a = 1;
printf("%d", a);


produces 1, but


int8 a;

a = 1;
prin ...
 
Page 1 of 1
All times are GMT - 6 Hours
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group