Created
June 10, 2014 02:54
-
-
Save cynx/20f6ce9ac7759a2d4470 to your computer and use it in GitHub Desktop.
C function to concatenate string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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