Vancamel

千山鸟飞绝,万径人踪灭。 孤舟蓑笠翁,独钓寒江雪。

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

http://www.cplusplus.com/reference/cassert/assert/

 

声明:void assert (int expression);

 1 #include <iostream>
 2 #include <cassert>
 3 
 4 using namespace std;
 5 
 6 void cout_number(int *myInt)
 7 {
 8     assert(NULL != myInt);
 9     cout << "myInt===========" << *myInt << endl;
10 }
11 
12 int main()
13 {
14     int a = 10;
15     int *b = NULL;
16     int *c = NULL;
17 
18     b = &a;
19     cout_number(b);
20     cout_number(c);
21     cout << "Hello World!" << endl;
22     return 0;
23 }
View Code

 

posted on 2017-05-21 16:04  我醉欲眠  阅读(431)  评论(0编辑  收藏  举报