NULL
野指针
pointer_at_large 就是一个野指针
1 #include <stdio.h> 2 #include <io_utils.h> 3 4 int *pointer_at_large; 5 6 void DangerousPointer() { 7 int a = 2; 8 pointer_at_large = &a; 9 // ... 10 pointer_at_large = NULL; 11 } 12 int main() { 13 // int *p = (int *)0x65fe18; // DANGEROUS !!! 14 // PRINT_INT(p); 15 // PRINT_HEX(&p); 16 // PRINT_INT(*p); 17 int *p = NULL; 18 //*p = 3; // error!! 19 20 if (p) { 21 PRINT_INT(21321); 22 } 23 DangerousPointer(); 24 if (pointer_at_large) { 25 PRINT_INT(*pointer_at_large); 26 } 27 return 0; 28 }
标签:int,禁忌,C语言,large,INT,PRINT,pointer,指针 From: https://www.cnblogs.com/liumy/p/17091345.html