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

please help with atoi()

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



Joined: 30 Jul 2007
Posts: 112
Location: Moscow, Russia

View user's profile Send private message

please help with atoi()
PostPosted: Sat Dec 13, 2008 11:33 am     Reply with quote

A have a string like
string[5]= "A2-1"
when i use atoi (string[3]) /(must be 1) it returns 0. Why?
RLScott



Joined: 10 Jul 2007
Posts: 465

View user's profile Send private message

Re: please help with atoi()
PostPosted: Sat Dec 13, 2008 11:40 am     Reply with quote

40inD wrote:
A have a string like
string[5]= "A2-1"
when i use atoi (string[3]) /(must be 1) it returns 0. Why?

atoi takes an address of a string. Try atoi( &string[3] );
_________________
Robert Scott
Real-Time Specialties
Embedded Systems Consulting
40inD



Joined: 30 Jul 2007
Posts: 112
Location: Moscow, Russia

View user's profile Send private message

PostPosted: Sat Dec 13, 2008 12:22 pm     Reply with quote

Thanks! It works!
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