Simon, The "outcome" of the '=' operation is to place the contents of the expression on the right side of the '=' into the location given by resolving the expression on the left side. No other processing or testing is performed; it is simply an assignment statement. However, in this example the "result" of the assigment is compared to '\0'; since after the assignment *s = *t both the locations pointed to by the pointers s and t have the same data in them, it matters not which one gets used for the comparison test against '\0'. No, in this example, the character that's being copied (from the location pointed by t to the location pointed to by s) is being tested to for that character is the C string termination char '\0'. If it is, it signals the end of the string (char by char) copy operation. Douglas Wood Software Engineer dbwood@kc.rr.com Home of the EPICIS Development System for the PIC and SX http://epicis.piclist.com ----- Original Message ----- From: "Simon Stirley" To: Sent: Friday, October 26, 2001 11:14 AM Subject: Re: [PIC]: or [EE]: C syntax question > > > Also, what is the logic behind understanding the actual > > test in the while > > > loop? I can't understand from the syntax exactly what is > > being compared to > > > '\0'. Is it *s? *t? If so, why? > > > > Well, since the char at the location pointed to by t is > > placed into the > > location pointed to by s, they both should now contain the > > same data. So it > > doesn't matter which location gets compared to zero. > > (\0). > > I thought it was the outcome of the = operation that was compared in a > compound statement like this .. ie. the operation was successful. In this > example I would expect the target of the copy to be null characters anyway, > otherwise you'd be over-writing some other string. > > Simon. > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. > > -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.