Re: Pascal vs C style string ?

nandu@cs.clemson.edu
Mon, 27 Jun 1994 20:05:13 GMT

          From comp.compilers

Related articles
Pascal vs C style string ? guerin@IRO.UMontreal.CA (1994-06-24)
Pascal vs C style string ? ssimmons@convex.com (1994-06-26)
Re: Pascal vs C style string ? prener@watson.ibm.com (1994-06-27)
Re: Pascal vs C style string ? jhallen@world.std.com (1994-06-27)
Re: Pascal vs C style string ? ddean@robadome.com (1994-06-27)
Re: Pascal vs C style string ? boehm@parc.xerox.com (1994-06-27)
Re: Pascal vs C style string ? nandu@cs.clemson.edu (1994-06-27)
Re: Pascal vs C style string ? eifrig@beanworld.cs.jhu.edu (1994-06-28)
Re: Pascal vs C style string ? monnier@di.epfl.ch (Stefan Monnier) (1994-06-28)
Re: Pascal vs C style string ? eru@tele.nokia.fi (Erkki Ruohtula) (1994-06-28)
Re: Pascal vs C style string ? andrew@cee.hw.ac.uk (1994-06-28)
Re: Pascal vs C style string ? jhallen@world.std.com (1994-06-28)
Re: Pascal vs C style string ? larryr@pa.dec.com) (1994-06-28)
[8 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: nandu@cs.clemson.edu
Keywords: C, Pascal, design
Organization: Compilers Central
References: 94-06-175
Date: Mon, 27 Jun 1994 20:05:13 GMT

guerin@IRO.UMontreal.CA:
!The use of zero-terminated strings restricts the contents of strings. They
!cannot include the zero byte. Length-attributed strings can contain
!arbitrary data.


    One hack around that could be to encode the zero byte as
    zero-zero bytes. The decoding routine identifies consecutive
    zero-zero bytes as the encoding of a single legal zero byte and
    understands that a singly occuring zero byte is actually the end of
    string marker. I believe this hack is used in transmitting packets
    over the network while agreeing upon a packet boundary pattern.
    Ofcourse, the normal string operations will have to re-written but if
    you could find an application that legally identifies the zero byte
    as part of a string....


--
Nandakumar Sankaran, G34 Jordan, Comp. Sci. Dept., Clemson Univ. SC 29634
311-8 Old Greenville Hwy. Clemson SC 29631-1651 (803)653-7749
http://www.cs.clemson.edu/~nandu/nandu.html nandu@cs.clemson.edu
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.