c程序设计中碰到的英译汉的问题

来源:百度知道 编辑:UC知道 时间:2024/09/26 16:30:22
Acceptance of data that differ from those intended for use by a program can cause system failures.
The following measiires should be taken to reduce data typing errors.

上面的英语是利用c语言进行程序设计应符合的标准中的一句话,该怎么理解?
Acceptance of data that differ from those intended for use by a program can cause system failures.
The following measures should be taken to reduce data typing errors.

续:Explicit casts should be used if practical in order to make the designer's intentions clear. Mixing signed and unsigned variables in arithmetic and logical operations can create
unexpected results (Porter, 1993). A hexadecimal number FFFF is - 1 in a signed 16-bit
integer and is 65535 in an unsigned 16-bit integer. This difference can change the outcome

接受那些不是为程序使用的数据可能导致系统失败。
应采取以下措施来减少数据输入错误。
如果实用的话应该引入显式转型以使设计者的意图更为明显。可以创造一些数学或逻辑方面的混合有符号、无符号变量。
意料之外的结果。在有符号的16位整数计数制情况下,十六进制数FFFF就是-1;而在无符号的16位整数计数制下却是65535。这一点区别会改变结果。

【这些在程序设计方面属于需要了解的背景知识,在计算机组成方面会详细讲,包括反码、补码及用反码补码进行加减乘除运算】

接受数据从一个程序可能会导致系统故障,用途不同。
以下measiires应采取的减少数据输入错误。