Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!nrl-cmf!ukma!rutgers!apple!amdcad!sun!pitstop!sundc!seismo!uunet!portal!cup.portal.com!PLS From: PLS@cup.portal.com (Paul L Schauble) Newsgroups: comp.arch Subject: String lengths Message-ID: <14331@cup.portal.com> Date: 5 Feb 89 06:25:30 GMT References: <6133@columbia.edu> <5124@aldebaran.UUCP> <7@microsoft.UUCP> <213@nbires.nbi.com> <38@microsoft.UUCP> <219@nbires.nbi.com> Distribution: na Organization: The Portal System (TM) Lines: 14 This deserves a new subject. Since it was mentioned in the Endian Wars, does anyone know why C uses the null terminated string rather than an explicit length? It seems like such an odd choice considering that - It removes a character from the character set, a source of many C bugs, and - All machines I know of that have character string instructions want the length of the string. This forces the string primitives to first scan for null, a time wasting operation. There must have been a reason. What is it? ++PLS