c ++ null pointer and the pointer field

Null pointer

Is null pointer of type void * can point to any type of object address

It may be used to initialize the pointer

But we do not have a null pointer access

 

Wild pointer:

Pointer variable points to an illegal memory space

For example, you go to the hotel, you just visit a room, but not before you open room.

On your behavior out of line, it is too much, that is wild meaning. Unauthorized access to the

#include <the iostream> 
the using namespace STD; 

int main () 
{ 
	int * P = (int *) 0x1100; 
	* P = 100; 
	COUT * P << << endl; // this process will collapse 
	return 0; 
}

  

Guess you like

Origin www.cnblogs.com/mch5201314/p/11684555.html