C语言学习-自我复习
C语言学习过程中-自己的疑问-通过学习并尽可能解决
frankqiaoguoxing
这个作者很懒,什么都没留下…
展开
-
(C语言之复习demo_10-自我复习使用-可供参考)_if 的四种句型深入解析,附带集合文氏图详解
#include <stdio.h>#include <math.h>#define EPS 1e-1int isTriangle(float a, float b, float c);int isIsoscelesTriangle(float a, float b, float c);int isRightAngledTriangle(float a, float b, float c);int isRegularTriangle(float a, float b,原创 2020-09-08 01:50:49 · 198 阅读 · 0 评论 -
(C语言之复习demo_09--自我复习使用-可供参考)-选择控制结构Switch语句复习- EPS常量 浮点数比较简介与应用-scanf %c格式符运用
#include <stdio.h>#include <math.h>#include <memory.h> #define EPS 1e-16/* 本篇复习介绍: 1、选择控制结构中的switch语句用法 2、关于scanf %c的应用, 详细可看我前面写的关于字符处理的博文 3、EPS应用两数近似比较、 EPS应用于判断浮点数是否含小数部分 浮点数比较EPS: 浮点数在计算机中存储的并不是准确的值,只是一个近似值。在精度范围内有效,超出原创 2020-09-07 00:42:18 · 437 阅读 · 0 评论 -
(C语言之复习demo_08--自我复习使用-可供参考--浮点数比较之EPS常量待后续补充)选择控制结构复习-附控制结构流程图画法
#include <stdio.h>#include <math.h>#include <stdlib.h>#define EPS 1e-15int main(){ /* 关系表达式: 用关系运算符将两个操作数连接起来组成的表达式,称为关系表达式. 关系表达式作用: 关系表达式通常用于表达一个判断条件,而一个判断的结果只有两种肯能:"真" 或者 "假" C语言中, 用非0值(也包括负数)表示"真", 用0值表示"假" 关系表达式的原创 2020-09-05 21:01:23 · 232 阅读 · 0 评论 -
(C语言之复习demo_07--自我复习使用-可供参考)屏幕输入输出_格式说明的格式修饰符用法_及scanf函数单项数据输入结束判别标志
#include <stdio.h>/* (1)init part - to give a init or a common part which is necessary for prog- -ram and can't be given commentary lines added on it. (2)indepent part - only one part can be existed in all demo when executing a program, Mean原创 2020-09-04 04:34:47 · 143 阅读 · 0 评论 -
(C语言之复习demo_06--自我复习使用-可供参考)对于字符,字符串在C语言在输入函数中使用的方法及要点(更新至20200925-----未完待续-----)
#include <stdio.h>/* 用户从键盘输入数据时,输入函数的处理过程 程序执行刚开始,第一次调用执行到输入函数时 (1)等待用户从键盘输入数据 (2)用户输入数据同时, 数据先被读到缓冲区 (3)计算机识别到输入结束标志,输入数据结束 (4)调用标准输入流读取缓冲区的数据保存到内存. (5)程序运行期间再次调用输入函数时,如果缓冲区有遗留数据,输入函数不会进行"等待用户输入数据"操作 (6)输入函数会直接从缓冲区读遗留数据,读取到缓冲区没有任何数原创 2020-09-03 03:32:09 · 173 阅读 · 0 评论 -
(C语言之复习demo_05--自我复习使用-可供参考)转义字符‘\0‘ 和 字符‘0‘ 及 数组学习时的 初见char a[6][4] ={(char)0x00} 形式
#include <stdio.h>int main(){ /* (1)目前计算机上广泛使用的字符集是ASCII码字符集, 每个字符都有一个等价的整型值与其相对应,这个整型值就是该字符的ASCII码. 从这个意义来说,可将char型看成是一种特殊的int型. (2)一个整型数在内存中是以二进制形式存储的, 而一个字符在内存中也是以其相对应的ASCII码的二进制形式存储的. (3)在ASCII码值取值范围内,对char型数据和int型数据进行互相转换不会丢失信息,二者可以进行原创 2020-09-02 01:55:40 · 223 阅读 · 0 评论 -
(C语言之复习demo_04--自我复习使用-可供参考)自动类型转换与强制类型转换
#include <stdio.h>/* (1)init part - to give a init or a common part which is necessary for program that can't be given by lines of commentary. (2)indepent part - only one part can be existed in all demo when executing a program, Meanwhile,Any o原创 2020-09-01 00:17:26 · 140 阅读 · 0 评论 -
(C语言之复习demo_03--自我复习使用-可供参考)宏常量, const常量 及 printf 和scanf语句 对 %f 和 %lf 使用注意
#include <stdio.h>#define MY_PI 3.14159/* (1)init part - to give a init or a common part which is necessary for program that can't be given by lines of commentary. (2)indepent part - only one part can be existed in all demo when executing a pro原创 2020-08-31 01:54:21 · 235 阅读 · 0 评论 -
(C语言之复习demo_02--自我复习使用-可供参考)自增自减与操作数构成算术表达式在程序中的两种情况 及 与同为单目运算符负号的优先级比较
#include <stdio.h>/* (1)init part - to give a init or a common part which is necessary for program that can't be given by lines of commentary. (2)indepent part - only one part can be exist in all demo when executing a program, Meanwhile,Any oth原创 2020-08-31 00:28:00 · 118 阅读 · 0 评论 -
C语言结构体内存对齐规律自我总结
C语言结构体内存对齐规律自我总结--如果有其他学习者已有一定理解,但是对某些地方还是有些疑惑,或许可以看懂我所写---主要为了自己总结复习--如有错误方便再改如果有其他学习者已有一定理解,但是对某些地方还是有些疑惑,或许可以看懂我所写—主要为了自己总结复习–如有错误方便再改)前要知识:CPU一次性能读取数据的二进制位数称为字长,一个字节=8位。那么32位处理器可以一次性最大处理4个字节的数据量。我们这里讨论的也是在32位计算机中,明白后可以按规律推广至64位计算机。那么在结构体中就需要注意,原创 2020-08-23 03:08:12 · 778 阅读 · 0 评论