copying target string from source string without using string functions

 #include<stdio.h>

int main()

{
    char str1[100];
    gets(str1);
    printf("str1:%s\n",str1);
    char str2[100];
    int j=0;
    for(int i=0; str1[i]!='\0';i++,j++)
    {
    str2[j]=str1[i];
    }
    str2[j]='\0';
    printf("str2:%s\n",str2);
}

Comments