Hi ,

Thanks for the much needed reply !


> - Read/write a variable length string from/to a version 4 database
> stream (the ptr variable).  There you have to determine the length of
> the string.  I could imagine two solutions for this:
>     - The bytes of the string are copied to the stream and are
> zero-terminated.  When reading from the stream you have to read from
> it byte by byte until you reach the '\0' byte.
>
I can imagine this as a possible solution, I think I'll go this way


>     - You write first the length of the string to the stream ("network
> long") and then the string itself.
>
I thought of this before, but this ain't possible, as "ptr" cannot be
jumped directly to the string length variable without exactly knowing the
string length. Correct me if I'm wrong.

Regards,
Shubham Rathore(:gabbar1947)
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel

Reply via email to