冯毅《程序设计基础c2014-c2
* A floating constant consists of an integer part, a decimal part, a fraction part, an e or E, an optionally signed integer exponent and an optional type suffix, one of f, F, l, or L. The integer and fraction parts both consist of a sequence of digits. Either the integer part, or the fraction part (not both) may be missing; either the decimal point or the e and the exponent (not both) may be missing. The type is determined by the suffix; F or f makes it float, L or l makes it long double, otherwise it is double. 08 bits 23 bits 101000…………….0 significand exponent 整数 . 小数 e 指数 * at execution time 美国信息交换标准码 American Standard Code for Information Interchange * a variable, is a location in storage Represent storage units in a program Used to store/retrieve data over life of program Type of variable determines what can be placed in the storage unit Assignment – process of placing a particular value in a variable Variables must be declared before they are assigned The value of a variable can change; A constant always has the same value Naming variables When a variable is declared it is given a name Good programming practices Choose a name that reflects the role of the variable in a program, e.g. Good: customer_name, ss_number; Bad : cn, ss; Don’t be afraid to have long names if it aids in readability Restrictions Name must begin with a letter; otherwise, can contain digits or any other characters. C is CASE SENSITIVE! Use 31 or fewer characters to aid in portability Variable names in C may only consist of letters, digits, and underscores and may not begin with a digit Variable names in C are case sensitive ANSI standard requires only 31 or fewer characters. Enhances portability to follow this rule Should be very descriptive In most cases, variables have no meaningful value at this stage. Memory is set aside for them, but they are not meaningful until assigned * Be careful to assign proper type – contract between declaration and assignments must be honored int x
您可能关注的文档
最近下载
- 2025年山东力明科技职业学院单招语文测试试卷大全.docx VIP
- 高考物理机械能常用模型最新模拟题精练专题31机械能+弹簧连接体+计算题(原卷版+解析).docx VIP
- 2025年湖南铁路科技职业技术学院单招职业技能考试题库及参考答案1套.docx
- 高考物理真题5年分类汇编专题10磁场(全国通用)(含解析).docx VIP
- 2025年成都七中自主招生物理试题 .pdf VIP
- 2025年城市管理协管员招聘考试(城市管理执法)历年参考题库含答案详解.docx VIP
- 保安服务方案 投标方案(技术标).doc
- 2024-2025学年人教版九年级上册化学期末专项训练:计算题(含解析).pdf VIP
- 【泰国投资促进委员会(BOI)】2025年投资促进项目申请指南.docx
- 陕西省09计价规则.pdf VIP
原创力文档

文档评论(0)