| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Squares |
> Its worse than that, the body of the loop gets a
> different range of s values of s too.
No, Jasen that would only be true of pre-increment which you and Darin
habitually use. I habitually use post-increment largely because I do not
habitually use C++.
The while (while(*s++){};) loop evaluates *s, and only if not zero
increments s - that's what post-increment means. On the next iterations it
looks at it again until *s=='\0'. Then it terminates.
It would make a difference only if the part in braces referenced or
altered s or *s. It doesn't.
If you don't believe me, look at it in debug.
Best Wishes,
Bill.
---
* Origin: Escan BBS (2:25/200)SEEN-BY: 633/267 270 @PATH: 25/200 108 252/110 250/501 140/1 106/2000 633/267 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.