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

int to Char array

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







int to Char array
PostPosted: Mon Feb 28, 2005 1:06 am     Reply with quote

Hello, me again, i was wondering if there was a way to convert and int to a char for example

int a=238
char=a
a=238

?
Thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Feb 28, 2005 1:30 am     Reply with quote

Quote:
i was wondering if there was a way to convert an int to a char

I'm not completely sure what you're talking about, but I think you
probably want to display an 8-bit unsigned value on your terminal window.
Do it like this:

int a;
a = 238

printf("%U\n\r", a);

This will convert the 8-bit value into ASCII digits followed
by a carriage return-linefeed, and send those characters out
the RS-232 transmit pin to your PC, where they will be displayed.
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