随笔分类 -  狄泰软件C语言

摘要:变量属性 C语言定义变量属性的关键字主要有auto、register、static、extern 1、auto关键字 2、register关键字 (1)register关键字指明将局部变量存储于寄存器中; (2)register只是请求寄存器变量,并不一定能成功; (3)register变量必须是C 阅读全文
posted @ 2018-10-23 18:02 chen_ace 阅读(157) 评论(0) 推荐(0)
摘要:分支语句 1、if语句 2、switch语句 注:case语句中的值只能是整型或者字符型常量 3、小结 <wiz_tmp_tag id="wiz-table-range-border" contenteditable="false" style="display: none;"> 来自为知笔记(Wi 阅读全文
posted @ 2018-10-23 18:02 chen_ace 阅读(137) 评论(0) 推荐(0)
摘要:类型转换 C语言中类型转换一般有强制类型转换与隐式类型转换两种; 1、强制类型转换 强制类型转换语法: 强制类型转换结果: 编程练习: #include <stdio.h> struct TS { int i; int j; }; struct TS ts; int main() { short s 阅读全文
posted @ 2018-10-23 18:01 chen_ace 阅读(123) 评论(0) 推荐(0)
摘要:浮点数的秘密 1、内存中的浮点数表示方法 浮点数在内存中的存储方式为:符号位、指数、尾数(小数) 2、浮点数存储示例 举例:实数8.25在内存中的表示 3、编程验证 #include <stdio.h> int main() { float f = 8.25; unsigned int* p = ( 阅读全文
posted @ 2018-10-23 18:01 chen_ace 阅读(173) 评论(0) 推荐(0)
摘要:有符号数与无符号数 1、计算机中的符号位 编程实验: #include <stdio.h> int main() { char c = -5; short s = 6; int i = -7; printf("%d\n", ( (c & 0x80) != 0 )); printf("%d\n", ( 阅读全文
posted @ 2018-10-23 18:00 chen_ace 阅读(369) 评论(0) 推荐(0)