C strcpy function

« Previous

Synopsis:

Example

#include <stdio.h>
char *strcpy (char *dest, char *src); 

Description:

The strcpy function copies characters from src to dest up to and including the terminating null character.

Return Value

The strcpy function returns dest.

Example

Example

#include <stdio.h>
int main() {
  char input_str[20];
  char *output_str;
  strcpy(input_str, "Learn");
  printf("input_str: %s\n", input_str);
  output_str = strcpy(input_str, "World");
  printf("input_str: %s\n", input_str);
  printf("output_str: %s\n", output_str);
  return 0;
}

Output Will Be :

Output

input_str: NewFile.
input_str: World
output_str: World


« Previous
Have Any Suggestion? We Are Waiting To Hear from YOU!

Your Query was successfully sent!