Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!wuarchive!rex!ames!haven!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Turbo C++ 1.0 Huge pointer addition error? Message-ID: <14837@smoke.brl.mil> Date: 13 Jan 91 02:32:44 GMT References: <9101122049.AA28040@lilac.berkeley.edu> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 13 In article <9101122049.AA28040@lilac.berkeley.edu> C512052@UMCVMB.BITNET ("David K. Drum") writes: - typedef struct { . . . } foo; - foo huge *hp1,hp2; That should be foo huge *hp1,*hp2; - hp2 = hp1 + sizeof(foo); - In my section of code, calculating the 20-bit addresses of hp1 and hp2 and then - subtracting hp1 from hp2 equals sizeof(foo) squared! Sounds to me like the compiler is doing precisely what you told it to. Perhaps you should read up on pointer arithmetic before proceeding.