![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C语言
文章平均质量分 78
海之渊
这个作者很懒,什么都没留下…
展开
-
C语言FAQ(1)
最近工作需要,都重新用起了C语言。很久没用,看了几本书,做个笔记。1. if 和 switch的使用注意 很多时候,我们可以发现很多场合if和switch可以替换使用。特别是在嵌入式系统中,什么时候使用if,什么时候用switch很让人迷惑。一般而言,当选项大于两个时就应该优先使用switch。 使用if的时候,很多时候为了方便我们都会很自然的使用else来替代其他可能条件,但这原创 2009-02-26 21:47:00 · 454 阅读 · 0 评论 -
CRC-16校验
CRC-16 IBM x16 + x15 + x2 + 1CRC编码的原理,网上有很多,简单的说就是将数据用生成式进行模2除法。这里我主要写一下,查表法的原理。一、原理:数据项:先查表获得Bn的两字节余式,将该余式的高8位与Bn-1进行模2运算,假定Bn-1,低8位与Bn-2进行模2运算,假定结构为Bn-2原创 2009-07-16 14:26:00 · 4108 阅读 · 0 评论 -
循环队列存储数据
再来一遍 近来在项目中,要在EEPROM中存储最近48小数的数据,使用的MCU为兼容的8052芯片(V9001,电能计量SOC),考虑到使用的是模拟I2C和52的处理能力,使用一个循环队列来控制数据存储的位置.一.队列构建struct Queue{ uint16 xdata *DataID; uint8 Size; uint8 front; //原创 2009-07-16 14:30:00 · 1509 阅读 · 0 评论 -
高质量C++/C编程指南
高质量C++/C编程指南 文件状态[ ] 草稿文件[√] 正式文件[ ] 更改正式文件文件标识: 当前版本:1.0转载 2009-07-17 17:18:00 · 1644 阅读 · 0 评论 -
Binary to Decimal Conversion in Limited Precision
Binary to Decimal Conversion in Limited Precision Part of the Arithmetic Tutorial Collection by Douglas W. Jones转载 2009-06-05 16:31:00 · 741 阅读 · 0 评论 -
BCD数计算
BCD Arithmetic, a tutorial Part of the Arithmetic Tutorial Collection by Douglas W. Jones转载 2009-06-05 16:29:00 · 1503 阅读 · 0 评论 -
Reciprocal Multiplication, a tutorial
Reciprocal Multiplication, a tutorial Part of the Arithmetic Tutorial Collection by Douglas W. Jones转载 2009-06-05 16:31:00 · 812 阅读 · 0 评论 -
C51语法错误日记(1)
今天,在写代码的时候,发现一个很容易犯的错误。代码 void main(){ unsigned int test; test=0x02; if(test&0x02==0x02) { test=0x02; } else { test=0x02; }}红色的代码本是判断test变量中的第二原创 2009-06-09 13:50:00 · 618 阅读 · 0 评论