Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!snorkelwacker!bloom-beacon!eru!luth!sunic!draken!d88-jwa From: d88-jwa@nada.kth.se (Jon Watte) Newsgroups: comp.sys.mac.programmer Subject: Re: String Copy in THINK C 4.0 Message-ID: <2834@draken.nada.kth.se> Date: 4 Feb 90 18:15:33 GMT References: <2083@quiche.cs.mcgill.ca> <2826@draken.nada.kth.se> <34105@ucbvax.BERKELEY.EDU> Reply-To: d88-jwa@nada.kth.se (Jon W{tte) Organization: Royal Institute of Technology, Stockholm, Sweden Lines: 16 In article <34105@ucbvax.BERKELEY.EDU> oster@dewey.soe.berkeley.edu.UUCP (David Phillip Oster) writes: >In article <2826@draken.nada.kth.se> d88-jwa@nada.kth.se (Jon W{tte) writes: >>memmove(p2, p1, *p1 + 1); /* copies pascal string p1 to p2 */ > ^ This is NOT the right way to get the length of a pascal This is, of course, the right and _efficient_ way to do _this_ operation. It doesn'n fail, given two legal pascal strings. I suppose I could even prove it, strongly. Of course, the rest of the article is right about _that_ special case, but that doesn't happen in this case. h+ -- --- Stay alert ! - Trust no one ! - Keep your laser handy ! --- h+@nada.kth.se == h+@proxxi.se == Jon Watte longer .sig available on request