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

rules for implementing string funktions with repetive call

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



Joined: 21 Dec 2004
Posts: 1

View user's profile Send private message

rules for implementing string funktions with repetive call
PostPosted: Tue Dec 21, 2004 7:27 am     Reply with quote

I have a problem with pointers to constant strings. I have read the forum and recognised that this is a big issue and mater. But what I tried to do is to compare a string with a constant string. It works in a symilar function strcpy.

Code:
strcpy(temp_string, "const string"); // That woks
copy(temp_string, "const string");   // Renamed function dosen't work


I simply tried to rename that function but it dosen't worke:


Code:
char *strcpy(char *s1, char *s2) //This funktion works
{
  char *s;

  for (s = s1; *s2 != 0; s++, s2++)
     *s = *s2;
  return(s1);
}


char *copy(char *s1, char *s2) //This function dosen't work
{
  char *s;

  for (s = s1; *s2 != 0; s++, s2++)
     *s = *s2;
  return(s1);
}

Does any one have an idea for that phenomenon?
What are the rules for implementing string funktions with repetive call in CCS?

Thanks
Sisyphus
future



Joined: 14 May 2004
Posts: 330

View user's profile Send private message

PostPosted: Tue Dec 21, 2004 8:47 am     Reply with quote

Probably both routines doesnt work, but CCS have an internal "strcpy" and probably it is using it.
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