CodesJava

Easy learning with example program codes

C strcpy()

C strcpy():

String Functions are the built-in functions provided by C to operate and manipulate a string. C strcpy() function copies a string from source to destination.

Syntax: 

strcpy(destination, source)

Example:

#include<stdio.h>  
#include <string.h>  
#include <stdbool.h>
 
void main()
{    
char str1[10] = "Hello C.";  
char str2[10];
 
strcpy(str2, str1);
puts(str2);
}

Output

Hello C.
Please follow and like us:
error
Posted in C   








Copyright © 2019 CodesJava DMCA.com Protection Status