| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Squares |
Hi Darin.
19-Apr-04 18:01:02, Darin McBride wrote to Neil Heller
DM> Hello Neil!
JB>>>>>> for( s=target ; *s ; s++ ) {
BB>>>> char *s=target; while(*s++) {...};
DM> The while statement will always increment s such that it points to
DM> the character after the nul, which means it's pointing to space
DM> that's either unallocated (the one byte after allocated memory is
DM> allowed to be pointed at, but not dereferenced, unlike the byte
DM> before allocated memory), or at least garbage
Its worse than that, the body of the loop gets a different range of s
values of s too.
DM> It's all just crazy. Loopy, I tell ya!
:)
-=> Bye <=-
---
* Origin: I smell a rat. Did you bake it or fry it? (3:640/1042)SEEN-BY: 633/267 270 @PATH: 640/1042 531 954 774/605 123/500 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™.