strcpy - String Copy


Code :

#include <stdio.h>
#include <stdlib.h>
void xstrcpy(char str[100],char str1[100]);
void main()
{
    char arr[100],arr1[100];
    printf("Enter string ");
    gets(arr);
    xstrcpy(arr,arr1);
}
void xstrcpy(char str[100],char str1[100])
{
    int i;
    for(i=0;arr[i]!='\0';i++)
    {
     str1[i]=str[i];
    }
    printf("copied string is: ");
    puts(str1);
}

Post a Comment

CodeNirvana
Newer Posts Older Posts
© Copyright Encyclopedia of C | Designed By Code Nirvana
Back To Top