I can understand the coding:
Qt Code:
  1. void strcpy(char *s, char *t) {
  2. int i = 0;
  3. while ((s[i] = t[i]) != '\0') i++; }
To copy to clipboard, switch view to plain text mode 
but if it is changed to:
Qt Code:
  1. void strcpy(char *s, char *t) {
  2. while ((*s = *t) != '\0') { s++; t++; } }
To copy to clipboard, switch view to plain text mode 
then I do not understand it.

In the first implementation, if someone calls strcpy(pname, star); then the function is passed two pointers to the values contained by the variables pname and star (which were previously declared as static char arrays BTW). Since we have told the function by the argument declaration (char *s, char *t) that its input is pointers, the function understands that the actual memory locations are to be updated and this is done by s[i] = t[i].

But in the second implementation what does *s = *t mean? How can first of all *s be used here? Since the declaration is strcopy (char *s, char *t) the variable names s and t refer to the same memory location as pname and star, but then, pname and star were not passed by reference. (No & there.) [In this case, I see that I should be questioning how the first implementation itself worked.] I am getting confused...

Obviously, I am a relative newbie to C and C++. Kindly be patient. Thanks.