设为首页 加入收藏

TOP

2.1.1 Integral Types (1)
2013-10-07 15:25:37 来源: 作者: 【 】 浏览:69
Tags:2.1.1 Integral Types

The arithmetic types that represent integers, characters, and boolean values are collectively referred to as the integral types.

一般把integral types 翻译为“整值类型”或“有序类型”;而“整型”特指int。

There are two character types: char and wchar_t. The char type is guaranteed to be big enough to hold numeric values that correspond to any character in the machine’s basic character set. As a result, chars are usually a single machine byte. The wchar_t type is used for extended character sets, such as those used for Chinese and Japanese, in which some characters cannot be represented within a single char.

The types short, int, and long represent integer values of potentially different sizes. Typically, shorts are represented in half a machine word, ints in a  

MACHINE-LEVEL REPRESENTATION OF THE BUILT-IN TYPES

The C++(www.cppentry.com) built-in types are closely tied to their representation in the computer’s memory. Computers store data as a sequence of bits, each of which holds either 0 or 1. A segment of memory might hold

00011011011100010110010000111011 ...

At the bit level, memory has no structure and no meaning.

The most primitive way we impose structure on memory is by processing it in chunks. Most computers deal with memory as chunks of bits of particular sizes, usually powers of 2. They usually make it easy to process 8, 16, or 32 bits at a time, and chunks of 64 and 128 bits are becoming more common. Although the exact sizes can vary from one machine to another, we usually refer to a chunk of 8 bits as a “byte” and 32 bits, or 4 bytes, as a “word.”

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇2.1.1 Integral Types (2) 下一篇5.12.4 Explicit Conversions

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·Java后端面试实习自 (2025-12-25 09:24:21)
·Java LTS版本有哪些 (2025-12-25 09:24:18)
·2025年,JAVA还值得 (2025-12-25 09:24:16)
·用 C 语言或者限制使 (2025-12-25 08:50:05)
·C++构造shared_ptr为 (2025-12-25 08:50:01)