//1,指针变量指向内存中编号为0的空间为空指针
//2,空指针指向的内存空间是不可以访问的
#include<iostream>
using namespace std;
int main() {
int a = 10;
int * p = &a;
cout << p << endl;
cout << &a << endl;
cout << "指针占" << sizeof(int *) <<"字节" << endl;
cout << "指针占" << sizeof(p) << "字节" << endl;
//1,指针变量指向内存中编号为0的空间为空指针
//2,空指针指向的内存空间是不可以访问的
int * q = NULL;
//0-255内存编号为系统占用,不允许用户访问
cout << *q << endl;
system("pause");
}
野指针:指针变量指向非法的内存空间
#include<iostream>
using namespace std;
int yezhizhen() {