Copy One String Into Other Using Library Function
#include<stdio.h> #include<conio.h> #include<string.h> void main() { char str1[100]; char str2[100]; printf("\nEnter the String 1 : "); gets(str1); strcpy(str2,str1); printf("\nCopied String : %s",str2); getch(); }
Output :
Enter the String 1 : c4learn Copied String : c4learn
Explain me ?
- Copy “str1″ into “str2″.
- Result will be stored in “str2″
- strcpy functions is included in Header File : string.h
Functions Required :
Incoming search terms:
- c program to copy one string to another using strcpy (3)
- c program to copy one string into another using strcpy (2)
- write a program to copy a string without using strcpy (2)
- c program to copy one string into another using library function (1)
- to copy one string to another without using library functions in c (1)
- WAP to copy one string to another without using library function by c (1)