On Fri, May 28, 2010 at 02:18:06PM -0400, Mike Caron wrote:
> On 28/05/2010 2:02 PM, James Paige wrote:
> >How do zstrings work?
> >
> >Back in the days of the one C/C++ class I took, I remember learning that
> >zstrings were a zero-terminated string buffer.
> 
> That's correct (but, they call it char*).
> 
> >They were no good for storing arbitrary binary data, because the first 0
> >would terminate the string, causing any data from the 0 to the end of
> >the buffer to be ignored.
> 
> That is also correct.
> 
> >Am I correct to assume that the zstring ptr's used in Reload are not
> >like that?
> >
> >I would hate to be losing saved tag data beccause 8 or more
> >low-numbered tags in a row happened to all be off.
> >
> >Please put my probably-unfounded fears to rest :)
> 
> No, ZStrings in FB work exactly like that.
> 
> However... ;)
> 
> There's nothing magical about a ZString or a char*. It's the string 
> functions which care about the null terminator. Otherwise, it's just an 
> arbitrarily sized chunk of memory.
> 
> If you ask RELOAD for a String back, you'll only get up to the first 
> null. But, if you ask for the ZString, you get the pointer to which you 
> can do whatever you want (up to the actual size of the memory block).

I feel much better now :)

---
James
_______________________________________________
Ohrrpgce mailing list
[email protected]
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org

Reply via email to