strcpy - Devbhoomi

FREE JOB ALERT & ONLINE TUTORIALS

Hot

Post Top Ad

Sunday 5 November 2017

strcpy

The strcpy(destination, source) function copies the source string in destination.
Syntax :
strcpy(destination, source)
Example :

    #include <stdio.h>

    int main(void)
    {
    char source[20]={'h','e','l','l','o','\0'};
    char destination[20];

    strcpy(destination,source);

    printf("Value of second string is : %s",destination);

    return 0;
    }

Output :
Value of second string is : hello

No comments:

Post a Comment

Post Top Ad