RE: [Dev-C++] Constructor and Destructor
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ioannis V. <iv...@em...> - 2003-07-10 20:35:57
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Abhijit Shylanath > Sent: Thursday, July 10, 2003 8:29 PM > To: Per Westermark > Cc: dev...@li... > Subject: RE: [Dev-C++] Constructor and Destructor > > > > > When you don't assign a value to b it will be > uninitialized, and set to > > any value that might be in memory. When you then call a > non-virtual method > > of the object, the method will thus get a random 'this' pointer. > > But shouldn't a protected-mode program crash when you try to access a > pointer that doesn't point to legally allocated memory? The behaviour of such calls is undefined. It may crash, it may not. Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net |