I am trying to write a string concatenation code. I wonder what is wrong in it. Can you guyz help me out. Here is my code.
#include <stdlib.h>
void strcat1(char *s, char *t)
{
while(*s !='\0')
s++;
while((*s++=*t++)!= '\0')
{
}
}
int main()
{
char s[]= "hello";
char t[]= "world";
strcat1(s,t);
printf("%s", s);
return 0;
}
I am getting this output on codepad.org: Disallowed system call: SYS_socketcal
Here is the link: http://codepad.org/Arz6U7YA
EDIT: Will the change char *s = "Hello" and char *t= "World" in the main function make any differenvce?