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 support@ccsinfo.com

functions for string process ?

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



Joined: 17 Jul 2012
Posts: 53

View user's profile Send private message

functions for string process ?
PostPosted: Wed Dec 05, 2012 6:27 pm     Reply with quote

I’ve read functions for string process in CCS user manual and I’ve got some questions as follow:
●cresult = strcmp(s1,s2)
As said in CCS user manual, cresult’s value may be -1 or 0 or 1 => so what type of cresult ? signed int8 or signed int16 or signed int32 ?
●iresult = strncmp(s1,s2,n)
As said in CCS user manual, iresult is an 8 bit int, but it doesn’t mention the meaning of this variable ! iresult has the same meaning as cresult above or it has a different meaning ?
●ptr = strstr(s1,s2) => means search for s2 in s1
However, I wonder what type of result “ptr” gets ? an address or something else ?

Hoping someone can give me an explanation ! Very Happy
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Dec 05, 2012 7:04 pm     Reply with quote

Look in the string.h file, in this directory:
Quote:

c:\program files\picc\drivers\string.h

It has the source code for those string functions. You can look at the
function declaration and see the type and the size of the return value.
small_chick



Joined: 17 Jul 2012
Posts: 53

View user's profile Send private message

PostPosted: Thu Dec 06, 2012 6:26 am     Reply with quote

Thanks PCM Programmer ! I'll try it! Very Happy
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