Program to copy string without using strcpy.

#include<stdio.h>
#include<string.h>
void main()
{
      char a[20],b[20],i;
      printf(“Enter the string”);
      gets(a);
      //logic for copy string
      for(i=0;a[i]!=‘0’;i++)
      {
             b[i]=a[i];
       }
      puts (b);
      getch();
}

One thought on “Program to copy string without using strcpy.

Leave a Reply

Your email address will not be published.