C标准库学习之<assert.h> ——诊断
2017-01-24 17:08
387 查看
#include <stdio.h> #include <assert.h> // 诊断 /* ========================================================= time: 2017年1月24日17:04:51 objective: test C language's head file of <assert.h> version: Microsoft Visual C++ author: ChenFei remark: 日文system 部分汉字需用拼音代替 ========================================================= */ int main(void) { int a; char str[50]; printf("Please enter a value."); scanf("%d", &a); assert(a >= 10); // assert(ture),程序继续执行 printf("Entered number is %d\n", a); // assert(false),程序跳出错误窗口,并打出错误信息。 printf("Please input string. "); scanf("%s", &str); assert(str != NULL); printf("The input string is %s\n", str); return 0; }
相关文章推荐
- C语言学习笔记(六)诊断<assert.h>
- C标准库学习之<ctype.h> ——字符处理
- 《C标准库》—之<assert.h>实现
- C标准库学习之<setjmp.h> ——非局部跳转
- c语言诊断_断言库函数#include<assert.h>
- C标准库学习之<errno.h> ——错误
- <assert.h>库学习
- C标准库学习之<math.h> ——数学函数
- C标准库学习之<stddef.h> ——定义部分宏
- Nullable<T>学习笔记
- Mule 学习系列<二> File Transport
- 有空看完<Beginning Xml with C# 2008>这本书, 深入学习一下Xml.
- EXTJS学习方案<二>
- 学习Extjs之旅<一>
- HtmlUnit学习<二>
- C#基础学习日志===>二维数组<===
- linux初学者学习大全&lt;转&gt;
- C#基础学习日志===&amp;amp;amp;amp;gt;命名空间的使用&amp;amp;amp;amp;lt;===
- C#基础学习日志===>二维数组<===
- HtmlUnit学习<->