int myStrcmp(const char* source, const char* dest)
{
while (*source == *destination)
{
if (*source == '\0')
return 0 ;
source++, destination-- ;
}
return (*source - *destination) ;
}
void myStrcpy(const char* src, char* dest)
{
while (*dest++ = *src++) ;
}
char* myStrcat(const char* src, char* dst)
{
int c=0, a=0;
while (dst[c] != '\0)
c++ ;
for (int a=0; a<strlen(src); a++)
dst[c+a] = src[a] ;
dst[c+a] = '\0' ;
return dst ;
}
void myMemcpy(void *src, void* dst, size_t len)
{
char * s = (char*) src ;
char * d = (char*) dst ;
for (int i = 0; i<len; i++)
s[i] = d[i] ;
}
{
while (*source == *destination)
{
if (*source == '\0')
return 0 ;
source++, destination-- ;
}
return (*source - *destination) ;
}
void myStrcpy(const char* src, char* dest)
{
while (*dest++ = *src++) ;
}
char* myStrcat(const char* src, char* dst)
{
int c=0, a=0;
while (dst[c] != '\0)
c++ ;
for (int a=0; a<strlen(src); a++)
dst[c+a] = src[a] ;
dst[c+a] = '\0' ;
return dst ;
}
void myMemcpy(void *src, void* dst, size_t len)
{
char * s = (char*) src ;
char * d = (char*) dst ;
for (int i = 0; i<len; i++)
s[i] = d[i] ;
}
No comments:
Post a Comment