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

Place Values

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



Joined: 11 Mar 2012
Posts: 45
Location: Egypt

View user's profile Send private message

Place Values
PostPosted: Wed Mar 14, 2012 9:01 pm     Reply with quote

Hello,

I have this variable which is 2 digits long eg.
Code:
var = 23;

I want to split it into two different variables which would have the values of:
Code:
var1 = 2;
var2 = 3;


How can this be done using CCS? I'm sorry I am a total noob when it comes to C operators.

Thanks in advance.

EDIT: it doesn't have to be split into two variables if I can just read the ones and tens place values separately.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Mar 14, 2012 9:24 pm     Reply with quote

http://www.ccsinfo.com/forum/viewtopic.php?t=39994&highlight=split+number
seifpic



Joined: 11 Mar 2012
Posts: 45
Location: Egypt

View user's profile Send private message

PostPosted: Wed Mar 14, 2012 9:26 pm     Reply with quote

PCM programmer wrote:
http://www.ccsinfo.com/forum/viewtopic.php?t=39994&highlight=split+number


Thanks, Sorry I searched for other keywords.
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