c copy string
snippet in c

c copy string

user5767

char *str = "Hello World!";
char copy[64];		// or 'char *copy = malloc(strlen(str) + 1);'
strcpy(copy, str);

c copy 2 strings\

user5783

#include <string.h>
#include <stdio.h>
int main()
{
  char str[9]="A string";
  char copy[9];
  strcpy(copy,str);
  printf("Copied String : %s",copy);
  return 0;
}