Implement the strcat function as efficiently as you can.. How do you handle errors if you had to
void strcat(char *str1,char *str2) {
while(*str1++) ; while((*str1++ = *str2++) != '\0') ; }
[code:1]char * str_cat(char *src, char*dest)
{ int i=0; int len= strlen(src); while(dest[i]!='\0') { i++; }
for(int j=0;j<=len;j++) { dest[i]=src[j]; i++; } return dest; }[/code:1]
VERY SIMPLE & EFFICIENT CODE
void strcat(char *str1,char *str2)
{
while(*str1++)
;
while((*str1++ = *str2++) != '\0')
;
}
Implement the strcat function
[code:1]char * str_cat(char *src, char*dest)
{
int i=0;
int len= strlen(src);
while(dest[i]!='\0')
{
i++;
}
for(int j=0;j<=len;j++)
{
dest[i]=src[j];
i++;
}
return dest;
}[/code:1]