Date: Fri, 24 Sep 1999 12:05:46 -0400 Message-Id: <199909241605.MAA29887@envy.delorie.com> From: DJ Delorie To: djgpp AT delorie DOT com In-reply-to: <00812b9d.360764bd@usw-ex0107-056.remarq.com> (message from Clemens Valens on Fri, 24 Sep 1999 07:49:13 -0700) Subject: Re: Pointers to base memory References: <19990924095602 DOT 28929 DOT rocketmail AT web1405 DOT mail DOT yahoo DOT com> <00812b9d DOT 360764bd AT usw-ex0107-056 DOT remarq DOT com> Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Where does ((char*)x)[1234] point to for unsigned int x=0? It points to the 1234'th byte of your program's code, although usually programs start at byte 4096. More likely it points into the unmapped page at the beginning of your program, so you'd get a segfault if you tried to use it. Remember, djgpp still uses segments - and your programs are *tiny* mode. You need a segment offset to get to memory outside your segment (like dos memory, video, etc). (unless you use nearptrs, of course).