strcpy

Navigation:  Programming language SQC > Libraries > String manipulation >

strcpy

Previous pageReturn to chapter overviewNext page

The strcpy() function copies one string into another.

It returns the address of the destination string.

 

char* strcpy(char *dst,char* src)

 

Example:

 
int main()

{

  char s1[10], 

       s2[10];

 

  strcpy( s1, "xxxxxx 1" );

  strcpy( s2, s1 );

  printf("s1 %s s2 %s ",s1,s2);

 

  return 0;

}

 

Output:

 

  s1 xxxxxx 1 s2 xxxxxx 1