STRCPY() FUNCTION IN C
#include<stdio.h> //header file stdio.h
#include<conio.h> //header file conio.h
#include<string.h> //header file string.h
main() //main() function
{ //start of the program
char a[10],b[10]; //string variable declaration
clrscr();
printf("enter the string ");
scanf("%s",a); //read the string from the user
strcpy(b,a); //strcpy() is use to copy string from a variable to b varaible
printf("the copied string is %s",b);
getch();
} // end of the program
#include<stdio.h> //header file stdio.h
#include<conio.h> //header file conio.h
#include<string.h> //header file string.h
main() //main() function
{ //start of the program
char a[10],b[10]; //string variable declaration
clrscr();
printf("enter the string ");
scanf("%s",a); //read the string from the user
strcpy(b,a); //strcpy() is use to copy string from a variable to b varaible
printf("the copied string is %s",b);
getch();
} // end of the program
No comments:
Post a Comment