Hello friends!!!!!
To copy one string to another
C LANGUAGE
11/25/20241 min read
// To copy all the characters from one string into another
#include <stdio.h>
#include<string.h>
int main() {
char a[50] = "Rishendra Ruppa";
printf("Given string is - %s\n", a);
char b[50];
strcpy(b , a);
// strcpy - to copy one string to another
printf("After copying, the string is - %s", b);
}
Output:
Given string is - Rishendra Ruppa
The length of the string is - Rishendra Ruppa
=== Code Execution Successful ===