Skip to content

Instantly share code, notes, and snippets.

@cynx
Created June 10, 2014 02:54
Show Gist options
  • Save cynx/20f6ce9ac7759a2d4470 to your computer and use it in GitHub Desktop.
Save cynx/20f6ce9ac7759a2d4470 to your computer and use it in GitHub Desktop.
C function to concatenate string
void strct(char s[],char t[]);
int main()
{
char s[7] = "mehul ";
char t[6] = "dhara";
strct(s,t);
printf("%s",s);
return 0;
}
void strct(char s[],char t[])
{
int i,j;
i=j=0;
while(s[++i] != '\0')
;
while((s[i++] = t[j++]) != '\0')
;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment