On Thu, Oct 09, 1997 at 03:48:51PM -0800, Andrew Warren wrote: > Martin R. Green wrote: > > > > > > while (*dest++ = *source++); > > > > Copy the thing pointed to by the source pointer to the location > > pointed to by the dest pointer, and increment the source and dest > > pointers AFTER the thing has been copied, ready for the next thing. > > After every copy from source to destination, the "while" examines > the value that was copied. If the value isn't equal to 0, the Just to expand further, this is really equivalent to while((*dest++ = *source++) != 0) continue; And it's actually not a bad idea to write it like that. It should generate exactly the same code as the original (if it doesn't, get a new compiler) and it makes it clear what you're doing. In Java, using the explicit != test is mandatory - Java does not allow arbitrary expressions to be used as boolean values, to avoid errors like: if(fred = 1) which is legal C, but almost certainly was meant to be if(fred == 1) Then there's the hoary old trap that I still fall into occasionally: if(fred & 0x60 == 0x20) which should have been if((fred & 0x60) == 0x20) becuz & has a lower precedence than ==. -- Clyde Smith-Stubbs | HI-TECH Software Email: clyde@htsoft.com | Phone Fax WWW: http://www.htsoft.com/ | USA: (408) 490 2885 (408) 490 2885 PGP: finger clyde@htsoft.com | AUS: +61 7 3354 2411 +61 7 3354 2422 --------------------------------------------------------------------------- ANSI C for the PIC! Now shipping! See www.htsoft.com for more info.