Overview In C, a string is simply an array of characters. We have used literal strings all along – the stuff in between the quotes in a printf is a literal string. A literal string can be stored in a character array for later use, just as you would store the value 12 in an int variable. The string library string.h provides several functions for manipulation strings. In this week’s lab, you will see static and dynamic ways of storing strings, and write your own versions of the string library function strcpy(), which copies one string into another.

Respuesta :

#include<stdio.h>

#include<string.h>

 

int main() {

  char str1[100];

  char str2[100];

 

  printf("\nEnter the String 1 : ");

  gets(str1);

 

  strcpy(str2, str1);

  printf("\nCopied String : %s", str2);

 

  return (0);

}