Mail Archives: djgpp/2001/03/17/02:57:35
> From: Sahab Yazdani <sahaby AT operamail DOT com>
> Newsgroups: comp.os.msdos.djgpp
> Date: Fri, 16 Mar 2001 20:24:35 -0500
>
> void foo() {
> bar = new bar();
> fprintf( stderr, "bar[afterinit]: %x\n", bar );
>
> fprintf( stderr, "bar[beforedestruct]: %x\n", bar );
> delete bar;
> }
>
> the strangeness is that the first time this function is called I get
> this (these are actual results of my program, obvoisly using function
> foo as an example):
>
> bar[afterinit]: 0x45eb8
> bar[ondestruct]: 0x45eb8
> bar[oninit]: 0xff4f31f0
> bar[ondestruct]: 0xff4f31f0
> SIGSEGV afterwards
>
> this shows that the pointer doesn't shift, so the code is okay, but the
> address of the second set of pointers points to memory in the 4GB
> region, which my computer doesn't have (although I wish it did :-)).
You didn't say what does the bar's constructor do. I'm guessing that
the key to unlock this is there.
- Raw text -