TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: NEIL HELLER
from: CHRIS DOWNS
date: 1997-10-22 06:49:00
subject: Re: CHAR[] STRINGS

 CD> Since you are defining 'string' to include the zero terminating byte
 CD> you've got it exactly right.  The string 'the' requires 4 bytes of
 CD> storage.  If you try to stuff it into 3 bytes, the 'the' gets stored
 CD> and where the zero has gone is anyone's guess.
 NH> The full "the0" gets stored.  The problem is that the first byte of
 NH> who-knows-what has been overwritten by the hex zero.
 Well, that certainly makes sense, but there's requirement that this 
 will happen.  It's also quite possible that the first three bytes get 
 stored "correctly" and then the program crashes with an access 
 violation....
---
 þ Blue Wave/QWK v2.12 þ
---------------
* Origin: St. Louis Users Group (1:100/4)

SOURCE: echomail via exec-pc

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™.