Mail Archives: djgpp/2000/06/27/19:45:21
radsmail AT juno DOT com (Radical NetSurfer) wrote in
<rt6ils4mql8imek537fpr0acsgkheqplbh AT 4ax DOT com>:
>Thank you, kind Sir.
>
>My understanding was that once a pointer is set to NULL,
>AFTER "destroying" it, I may RE-ASSIGN (this is the crucial part you
>see) THAT SAME POINTER once again to the
>Another NEWLY created object OF THE SAME TYPE...
of course. but you should not dereference the pointer before it again points
to valid storage. this is where i am guessing you have a problem.
of course, it is hard to give any more information because you do not show any
code that exhibits your problem.
>PS: I have discovered that my program runs more successfully
> within a Windows 3.11 (yes! MANY people ARE still using Win3.11)
> and that delighted me to see that work!
win 3.x dpmi server suffers from the same problem (not catching accesses to
invalid storage) as the win 9x server.
just yelling at people instead of trying to find your mistake is not going to
make you a better programmer.
do try the following:
>>for further enlightenment, you can test the following program under dos
>>and in a dos window under windows 9x.
>>
>>#include <stdlib.h>
>>
>>int main(void) {
>> char* nullpointer = NULL;
>> *nullpointer = 'c';
>> return 0;
>>}
you'll see that the program runs 'perfectly' (by your definition) under
windows, and crashes with a SIGSEGV in dos. this way you can track down places
in your program where you are writing to memory areas which you shouldn't
write to.
also check out the 'weird problems' section of the comp.lang.c FAQ, in
particular:
http://www.eskimo.com/~scs/C-faq/q16.5.html
http://www.eskimo.com/~scs/C-faq/q16.8.html
if you want more help, you need to provide an example of code that exhibits
your problem.
Sinan.
--
--------------------------------
A. Sinan Unur
http://www.unur.com/
- Raw text -