-
-
Save liovch/5158302 to your computer and use it in GitHub Desktop.
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
#include <stdio.h> | |
/*int main(int argc, const char * argv[])*/ | |
void concat(char* str1, char* str2, char* output); | |
{ | |
int i, j, k; | |
i = j = k = 0; | |
while (str1[i] != '\0') | |
{ | |
output[k] = str1[i]; | |
i++; | |
k++; | |
} | |
while (str2[j] != '\0') | |
{ | |
output[k] = str2[j]; | |
k++; | |
j++; | |
} | |
output[k] = 0; | |
} | |
int main() { | |
char str1[256] = "Try to learn"; | |
char str2[256] = "C and C++ maybe"; | |
char output[1000]; | |
concat(str1, str2, output); | |
printf("%s", output); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment