#include char *strcpy( char s1[], char s2[] ) { char *retVal = s1; // Save s1 to return /* ---------------------------------- '\0' marks the end of the string ! ---------------------------------- */ while ( *s2 != '\0' ) // Not end of s2 { *s1++ = *s2++; // Copy current character // Move to next character } *s1 = '\0'; // Mark the end of the s1 string return(retVal); } int main(int argc, char *arg[]) { char a[] = "Hello"; char b[10]; strcpy(b, a); printf("b = %s\n", b); }