void copy(char* destination, const char* source) { while (*destination++ = *source++); // stops when *destination == 0, i.e. at end of string } void main() { char string1[] = "Hello STL"; char string2[] = "Hello world"; copy(string2, string1); // copies string1 into string2 }