Pointer mess
-
there are some memory check functions as _CrtIsValidPointer() It is strongly recommanded to avoid this situation. use pointers to data, only for copying the data, if you need it later. -> make your own object :-O
Press F1 for help or google it. Greetings from Germany
-
To check the validity of the pointer in Windows there are API functions called IsBadReadPtr and IsBadWritePtr to do that. P.S. While using pointer developer should be careful that pointer is set to NULL once it is deleted. And not to use the deleted pointer before allocating memory.
The secret of life is not enjoyment but education through experience. - Swami Vivekananda.
-
There is no reasonable and fool proof way to make this check. You as a programmer must ensure that this never happens. Smart pointers can help you to an extent.
«_Superman_» I love work. It gives me something to do between weekends.