摘要: 摘自书本内容: 补码: 12 原码和反码都不便于计算机内的运算,因为在运算中要单独处理其符号。例如,对以原码表示的+7和-7相加,必须先判断各自的符号位,然后对7位进行相应的处理,很不方便。 11 1 因此,最好能做到将符号位和其它位统一处理。对减法也按加法来处理。这就是“补码”。 10 2 补码的 阅读全文
posted @ 2019-11-08 16:52 博客_在线 阅读(987) 评论(0) 推荐(0)
摘要: C++->文件流的输入输出 1.书本里以“简单事务处理”为例子,解析二进制输入输出文件流的read和write函数的使用,以及输入输出文件流 过程中指针的捕获、定位,文件流位置的判断,二进制文件转换为文本文件。 1.1.二进制文件流的read函数的原型:read(char *buffer,strea 阅读全文
posted @ 2019-11-07 11:30 博客_在线 阅读(2409) 评论(0) 推荐(0)
摘要: C++ -> 在使用动态链表和异质链表产生野指针的步骤 使用异质链表产生野指针的情况,下面是修改书本的例子: //ex8_12.cpp #include<iostream.h> #include<string.h> #include<assert.h> #include<iomanip.h> #in 阅读全文
posted @ 2019-11-06 11:18 博客_在线 阅读(268) 评论(0) 推荐(0)
摘要: 以读或写方式打开一个文件 #include<iostream.h> //.h以C|非C标准引用库文件 #include<fstream.h> #include<stdlib.h> void main() { fstream fst; char *fn,cn[50]; fn=&cn[1]; // ci 阅读全文
posted @ 2019-10-24 21:39 博客_在线 阅读(893) 评论(0) 推荐(0)
摘要: /* a b c d 1 5 5 1 2 5 5+5 2 1 3 5 5+5+5 3 2 1 4 5+5 10+5+5 3 2 1 5 10+5=15 15+10+5 3 2 1 6 10+5+5=20 20+15+10 3 2 7 20+10=30 3 30+20+15 8 20+10+15=45 阅读全文
posted @ 2019-10-17 12:06 博客_在线 阅读(1489) 评论(0) 推荐(0)
摘要: List容器的应用: // 单链队列 队列的链式存储结构 typedef struct QNode{ typedef struct{ QElemType data; QueuePtr front; //队头指针 struct QNode *next; QueuePtr rear; //队尾指针 }Q 阅读全文
posted @ 2019-10-13 13:34 博客_在线 阅读(289) 评论(0) 推荐(0)