Path: utzoo!attcan!uunet!husc6!endor!singer From: singer@endor.harvard.edu (Rich Siegel) Newsgroups: comp.sys.mac.programmer Subject: Re: Pointer Subtraction in THINK C 3.0 Message-ID: <5094@husc6.harvard.edu> Date: 8 Aug 88 03:07:22 GMT References: <63033@sun.uucp> Sender: news@husc6.harvard.edu Reply-To: singer@endor.UUCP (Rich Siegel) Organization: Symantec/THINK Technologies, Bedford, MA Lines: 23 In article <63033@sun.uucp> swilson@sun.UUCP () writes: >It looks as though THINK C 3.0 is using long as the resulting type for >pointer subtraction. (A long gets pushed on the stack instead >of an int, its upper two bytes are zero so printi prints 0.) Right. Though I'm not a C god, my guess is that pointers are treated as longs in that the difference of two pointers is a pointer, not an int. The solution? Either cast the result, or use prototypes. --Rich Rich Siegel Quality Assurance Technician THINK Technologies Division, Symantec Corp. Internet: singer@endor.harvard.edu UUCP: ..harvard!endor!singer Phone: (617) 275-4800 x305