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

:)
:(
hihi
:-)
:D
=D
:-d
;(
;-(
@-)
:o
:>)
(o)
:p
:-?
(p)
:-s
8-)
:-t
:-b
b-(
(y)
x-)
(h)