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

int8 or char variable?

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



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

int8 or char variable?
PostPosted: Wed May 01, 2013 4:20 pm     Reply with quote

Simple question....

I'm capturing a series of 8bit data on a port and will be storing the word in a variable to be formatted and printed at a later time. Which do you believe would be better, an int8 or a char for the variable? Or would it really matter?

Ronald
Ttelmah



Joined: 11 Mar 2010
Posts: 19535

View user's profile Send private message

PostPosted: Wed May 01, 2013 4:26 pm     Reply with quote

Doesn't matter at all.
In some languages, using things like unicode, they are different, but in CCS (assuming PCH PCB or PCM), they are identical.
I'd probably use BYTE, since this is inherently unsigned, while int8 on most computers is signed (it isn't in CCS).

Best Wishes
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Wed May 01, 2013 4:40 pm     Reply with quote

Thanks. Figured as such but I thought I'd just make sure.

Ronald
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