Chinaunix首页 | 论坛 | 博客
  • 博客访问: 15036
  • 博文数量: 17
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 0
  • 用 户 组: 普通用户
  • 注册时间: 2016-07-22 15:44
个人简介

Be better

文章分类

全部博文(17)

文章存档

2016年(12)

2015年(5)

我的朋友

分类: C/C++

2016-03-23 12:06:47

#define  _CRT_SECURE_NO_WARNINGS


#define DEBUG
#include
#include
#include
#include


#ifndef DEBUG
#define myassert(x)//没有代码检测提示
#else
#define myassert(x)\
if(!(x))\
{\
printf("myassert(%s)宏开适检测......\n",#x);\
printf("当前函数名为%s,文件名为%s,代码行为%d",__FUNCTION__,__FILE__,__LINE__ );\
char str[50];\
sprintf(str,"当前函数名为%s,文件名为%s,代码行为%d",__FUNCTION__,__FILE__,__LINE__ );\
MessageBoxA(0,str,"错误提示",0);\
}
#endif


void main()
{
int num = 10;
num = 20;
myassert(num < 20);


system("pause");
}
阅读(418) | 评论(0) | 转发(0) |
0

上一篇:冒泡法二分法

下一篇:usrp N210 牛刀小试

给主人留下些什么吧!~~