- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
* * 分析程序运行结果: main() { int i=3,j=4; printf(i=%d,j=%d,i+++j=%d\n,i,j,i+++j); i=3; printf(i+++j=%d,i=%d,j=%d\n,i+++j,i,j); } i=4,j=4,i+++j=7 i+++j=7,i=3,j=4 * Execution of an assignment statement is done in two distinct steps: Evaluate the expression on the right hand side Store the value of the expression into the variable named on the left hand side * * * Value: of comma expression is equal to the value of expn * * * “greater than” “less than” = “greater than or equal to” = “less than or equal to” == “is equal to” != “is not equal to” * 例 应避免对实数作相等或不等的判断 如 1.0/3.0*3.0==1.0 结果为 可改写为:fabs(1.0/3.0*3.0-1.0)1e-6 0 * * * * * * * * * * * * * * * * * * * * * * * * User-defined identifier Built-in identifier * Including blanks, horizontal and vertical tabs, newlines, formfeeds and comments * * 大千世界可以分类,同样C语言程序中的数据也可以分类 * char A single byte capable of holding one character in the local character set int An integer, typically reflecting the natural size of integers on the host machine float Single-precision floating point (typically 8-bit) double Double-precision floating point (typicall 4-bit) * 目前计算机中用得最广泛的字符集及其编码,是由美国国家标准局(ANSI)制定的ASCII码(American Standard Code for Information Interchange,美国标准信息交换码), -215~215-1 0~216-1 -231~231-1 0~232-1 尾数+阶数 char variable type Represents a single byte (8 bits) of storage Can be signed or unsigned Internally char is just a number Numerical value is associated with character via a character set. ASCII character set used in ANSI C Question: what is the difference between: printf(“%c”, someChar); printf(“%d”, someChar);浮 int variable type点数存储: Represents a signed integer of typically 4 or 8 bytes (32 or 64 bits) Precise size is machine-dependent Question: What are the maximum and minimum sizes of the following: 32-bit unsigned int 32-bit signed int 64-bit signed/unsigned int What happens if these limits are exceeded? float and double variable types Represent typically 32 and/or 64 bit real numbers How these are r
文档评论(0)