i am trying to combine 2 strings to be one without using strcat function, but get some errors, anyone can help me?
#include<stdio.h>
#include<conio.h>
#include<string.h>
char str[200];
char *combine(char *str1,char *str2){
int i,j ,k;
while (str1[i]) str[k++] = str1[i++];
while (str2[j]) str[k++] = str2[j++];
str[k]= '\0';
return str;
}
void main(void){
char str1[100], str2[100];
printf("string1:"); gets(str1);
printf("string2");gets(str2);
printf("combination of 2 strings: %s",combine(str1,str2));
getch();
}