![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
畏天
心之所向,身之所往
展开
-
CRC校验代码简单注解
unsigned short CRC16_CCITT(unsigned char *puchMsg, unsigned int usDataLen){ ;//根据CRC16的标准选择初值CRCIn的值 unsigned short wCRCin = 0x0000 unsigned short wCPoly = 0x1021; unsigned char wChar = 0; whil...原创 2020-03-26 15:33:18 · 490 阅读 · 0 评论 -
在分配内存中使用sizeof确定分配空间大小的优点
sizeof是在编译期间计算的,因而不会带来运行时性能上的损失。 sizeof时可移植的,在不同的环境 下重新编译,编译器将自动修改sizeof计算出来的值。 sizeof可以用于计算自定义的结构体的大小。 --- 《code complete》...原创 2019-11-12 11:04:37 · 345 阅读 · 0 评论 -
C++文件操作:按行读取复制到另一个文件
由于对C++的文件操作并不是太熟练,因此复习了一下顺便写了一个小例子用来巩固,顺便解决了换行的问题:#include <iostream>#include <string>#include <fstream>using namespace std;int main(int argc, char *argv[]){ string buf0,...原创 2019-08-07 16:14:33 · 1712 阅读 · 0 评论