4c5 Subj : Re: null pointer becomes 1 To : borland.public.cpp.borlandcpp From : "heon" Date : Mon Oct 20 2003 06:54 am maeder@glue.ch (Thomas Maeder [TeamB]) wrote: >"heon" writes: > >> I dumped the pointer value and I expected it to be 0. but it came out as 1. > >The most probable reason is that your program somewhere overwrits memory it >shouldn't. Could you reduce your program to the *minimal* size (<50 lines) >that still has the problem and post the result? I think so, too. But I couldn't find where. In my_process structure, I changed my_process_class* to void* like this: FROM: stypedef struct my_process { my_process_class* mpProcess; my_process_flag* mpFlag; long mCount; } MY_PROCESS; TO: stypedef struct my_process { void* mpProcess; my_process_flag* mpFlag; long mCount; } MY_PROCESS; Whenever I need mpProcess, I cast it to my_process_class*. With this change, everything works fine now. It doesn't make sense to me why my_process_class* works differently than void*. Do you have any idea? thank you. . 0