Xref: utzoo comp.sys.ibm.pc:22267 comp.sys.intel:604 Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!purdue!bu-cs!dartvax!eleazar.dartmouth.edu!earleh From: earleh@eleazar.dartmouth.edu (Earle R. Horton) Newsgroups: comp.sys.ibm.pc,comp.sys.intel Subject: Re: correct code for pointer subtraction Message-ID: <11477@dartvax.Dartmouth.EDU> Date: 15 Dec 88 04:58:15 GMT References: <15813@iuvax.cs.indiana.edu> Sender: news@dartvax.Dartmouth.EDU Reply-To: earleh@eleazar.dartmouth.edu (Earle R. Horton) Organization: Thayer School of Engineering Lines: 16 In article <15813@iuvax.cs.indiana.edu> bobmon@iuvax.UUCP (RAMontante) writes: ... >So I agree with Bill Davidsen that the rigorous way to do this is to >cast the pointers to huge, and subtract the casts. Viz., ... I don't think anyone has suggested this, but perhaps casting to long might be a better way to do this, and portable, too! I don't do much 8086 stuff, but a long int is the same size as a long pointer on just about every system I have run across. Subtraction of longs is never a questionable operation, either, whereas pointer subtraction sometimes is... Earle R. Horton. 23 Fletcher Circle, Hanover, NH 03755 (603) 643-4109 Graduate student.