Path: utzoo!mnetor!uunet!mcvax!jack From: jack@cwi.nl (Jack Jansen) Newsgroups: comp.arch Subject: Re: Null-terminated C strings Message-ID: <152@piring.cwi.nl> Date: 23 Dec 87 20:34:07 GMT References: <14116@think.UUCP> <2958@okstate.UUCP> Organization: AMOEBA project, CWI, Amsterdam Lines: 20 Even though I favour null-terminated strings myself there is a very strong point against them: Very little error checking is possible in the runtime system. Look at the bug reports in comp.bugs.4bsd for instance: I would guess that about 25% of the bug reports is about programs that silently assume that no mail-address/line/whatever will ever be more than NSTR characters. I know, the programmer can cater for this, but it shouldn't be her business. Moreover, the approach where the count is kept with the pointer has another *big* advantage: it unifies strings with other variable dimension arrays. Again, this is not a point that I feel very strong about myself (I don't think I *ever* inverted a matrix), but it *is* rather stupid that you have to specify the dimensions of a matrix in a call some routine while the compiler knows those dimensions already.... -- Jack Jansen, jack@cwi.nl (or jack@mcvax.uucp) The shell is my oyster.