Q:

String copy in C

0

String copy in C

 

C program to copy a string using library function strcpy

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

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

int main()
{
  char source[1000], destination[1000];

  printf("Input a string\n");
  gets(source);

  strcpy(destination, source);

  printf("Source string: %s\n", source);
  printf("Destination string: %s\n", destination);

  return 0;
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now