Copy a string : String Copy « String « C / ANSI-C






Copy a string

  
#include <stdio.h>
#include <string.h>

int main(void)
{
  char str[80] = "I like C";

  strcpy(str, "I like Java");
  printf(str);

  return 0;
}

           
       








Related examples in the same category

1.how to use strcpy (string copy)
2.A simple string copy
3. Copy string: how to use strcpy
4. Copy characters from one string to another: how to use strncpy
5.String copy: assign the pointer value