Q:

String copy in C

0

String copy in C

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;
}

otput:

input the string

oh boy

"oh boy"

"oh boy"

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