(程式语言).ppt

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
(程式语言)

Programming Language (程式語言) Chapter 6 Data Types (資料型態) Topics Introduction Primitive data types (基本資料型態) Character string types (符號字串型態) User-defined ordinal types (使用者定義順序型態) Array types (陣列型態) Associative arrays (關聯陣列) Record types (紀錄型態) Union types (聯合型態) Pointer and reference types (指標與參考型態) Introduction Data type defines A collection of data objects and a set of predefined operations on those objects 一群資料物件與再這物件上被預先定義運算集合 Primitive Data Types Almost all programming languages provide a set of primitive data types Primitive data types Those not defined in terms of other data types 沒有被定義再其他的資料型態中 Some primitive data types are merely (只是) reflections (反映) of the hardware Integer type Others require (需要) only a little non-hardware Integer The most common privative numeric (數字的) data type is integer Java’s signed integer sizes byte, short, int, long C++ and C# include unsigned integer types Unsigned types are often used for binary data Floating Point Model real numbers, but only as approximations (近似值) Languages for scientific (科學) use support at least two floating-point types Float and double IEEE Floating-Point Standard 754 IEEE Standard 754 Floating-Point Decimal (10進位) For business applications (money) Essential (基本) to COBOL C# offers a decimal data type Store a fixed number of decimal digits Advantage Accuracy (準確) Disadvantages Limited range (有限的範圍) Wastes memory (消耗記憶體) Boolean Simplest (最簡單) of all Range of values: two elements True False Could be implemented as bits, but often as bytes Advantage Readability Character (字元) Stored as numeric (數值) codings Most commonly used coding: ASCII An alternative, 16-bit coding: Unicode Includes characters from most natural languages Originally used in Java C# and JavaScript also support Unicode Character String Types Values are sequences of characters Design issues Should strings be simply a special kind of character array or a primitive type? Should strings have static or dynamic length? Character String Types Op

文档评论(0)

cj80011 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档