sisyphus
Joined: 21 Dec 2004 Posts: 1
|
rules for implementing string funktions with repetive call |
Posted: Tue Dec 21, 2004 7:27 am |
|
|
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 |
|