Saturday, July 27, 2019

String in strcpy() function

String in strcpy() function:


String in strcpy() function



The strcpy() function is defined in <string.h> header file.

The strcpy() function copies the string pointed by source

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char a[20]="cprograms";
char b[20];
char c[20];
clrscr();

strcpy(b,a);
strcpy(c,"hii");
puts(b);
puts(c);
getch();

}

Output:



EmoticonEmoticon