C language how to copy strings

C language how to copy strings
#include <string.h>
#include <stdio.h>
int main()
{
  char str[12]="hello world";
  char copy[15];
  strcpy(copy,str);
  printf("Copied String : %s",copy);
  return 0;
}
Sou‮‬rce:www.lautturi.com

Note that the length of the array "copy" must be greater than or equal to the string length, otherwise data will be lost and garbled code will be displayed when printing.

Created Time:2017-08-29 04:24:12  Author:lautturi