C++中 integer 是什么意思

如题所述

  integer是整数,整型的意思。

  整数(integers)就是像-3,-2,-1,0,1,2,3等这样的数。
  整数的全体构成整数集,整数集是一个数环。在整数系中,零和正整数统称为自然数。-1、-2、-3、…、-n、…(n为非零自然数)为负整数。则正整数、零与负整数构成整数系。
  C++这个词在中国大陆的程序员圈子中通常被读做“C加加”,而西方的程序员通常读做“C plus plus”,“CPP”。 它是一种使用非常广泛的计算机编程语言。C++是一种静态数据类型检查的、支持多重编程范式的通用程序设计语言。它支持过程化程序设计、数据抽象、面向对象程序设计、泛型程序设计等多种程序设计风格。
    
温馨提示:内容为网友见解,仅供参考
第1个回答  2011-03-07
,有时候也称为primitive types)完整的定义(节录自C++03标准):
3.9.1 Fundamental types [basic.fundamental]
1 Objects declared as characters (char) shall be large enough to store any member of the implementation’s
basic character set. If a character from this set is stored in a character object, the integral value of that character
object is equal to the value of the single character literal form of that character. It is implementationdefined
whether a char object can hold negative values. Characters can be explicitly declared unsigned
or signed. Plain char, signed char, and unsigned char are three distinct types. A char, a
signed char, and an unsigned char occupy the same amount of storage and have the same alignment
requirements (3.9); that is, they have the same object representation. For character types, all bits of
the object representation participate in the value representation. For unsigned character types, all possible
bit patterns of the value representation represent numbers. These requirements do not hold for other types.
In any particular implementation, a plain char object can take on either the same values as a
signed char or an unsigned char; which one is implementation-defined.
2 There are four signed integer types: “signed char”, “short int”, “int”, and “long int.” In this
list, each type provides at least as much storage as those preceding it in the list. Plain ints have the natural
size suggested by the architecture of the execution environment39) ; the other signed integer types are provided to meet special needs.
3 For each of the signed integer types, there exists a corresponding (but different) unsigned integer type:
“unsigned char”, “unsigned short int”, “unsigned int”, and “unsigned long
int,” each of which occupies the same amount of storage and has the same alignment requirements (3.9)
as the corresponding signed integer type40) ; that is, each signed integer type has the same object representation
as its corresponding unsigned integer type. The range of nonnegative values of a signed integer type
is a subrange of the corresponding unsigned integer type, and the value representation of each corresponding
signed/unsigned type shall be the same.
4 Unsigned integers, declared unsigned, shall obey the laws of arithmetic modulo 2n where n is the number
of bits in the value representation of that particular size of integer.41)
5 Type wchar_t is a distinct type whose values can represent distinct codes for all members of the largest
extended character set specified among the supported locales (22.1.1). Type wchar_t shall have the same
size, signedness, and alignment requirements (3.9) as one of the other integral types, called its underlying
type.
6 Values of type bool are either true or false.42) [Note: there are no signed, unsigned, short, or
long bool types or values. ] As described below, bool values behave as integral types. Values of type
bool participate in integral promotions (4.5).
7 Types bool, char, wchar_t, and the signed and unsigned integer types are collectively called integral
types.43) A synonym for integral type is integer type. The representations of integral types shall define values
by use of a pure binary numeration system.44) [Example: this International Standard permits 2’s complement,
1’s complement and signed magnitude representations for integral types. ]
8 There are three floating point types: float, double, and long double. The type double provides
at least as much precision as float, and the type long double provides at least as much precision as
double. The set of values of the type float is a subset of the set of values of the type double; the set
of values of the type double is a subset of the set of values of the type long double. The value representation
of floating-point types is implementation-defined. Integral and floating types are collectively
called arithmetic types. Specializations of the standard template numeric_limits (18.2) shall specify
the maximum and minimum values of each arithmetic type for an implementation.
9 The void type has an empty set of values. The void type is an incomplete type that cannot be completed.
It is used as the return type for functions that do not return a value. Any expression can be explicitly converted
to type cv void (5.4). An expression of type void shall be used only as an expression statement
(6.2), as an operand of a comma expression (5.18), as a second or third operand of ?: (5.16), as the operand
of typeid, or as the expression in a return statement (6.6.3) for a function with the return type void.
10 [Note: even if the implementation defines two or more basic types to have the same value representation,
they are nevertheless different types. ]
概括而言,C++的对象基本类型包括整数类型(其中又包括字符类型(char和wchar_t)、常规的整数类型(singned和unsigned的int、char、short、long、long long)、bool类型)、浮点数类型(float、double和long double)和void类型。标准定义了编译器实现它们的对象的内置操作时必需满足的特征。对于int、double这类数值类型的操作的具体实现,编译器一般只是把源代码编译成对应平台上的机器(例如CPU或GPU)指令,而指令内部的操作方法由硬件实现(对于现代数字式通用电子计算机而言,是二值数字逻辑电路计算一定的逻辑表达式,然后按约定的格式(例如IEEE-754浮点数规范中定义的)进行输出,具体内容可以参考计算机组成原理和编译原理等相关课程),在C++语言级别上没有源代码;不过对于一些机器指令不直接支持的计算,编译器可以用软件方法实现(例如32位平台的long long运算,无FPU机器的浮点计算),这里的源码就是编译器对应部分的源码(是平台相关的,可能是汇编的,也可能是高级语言——例如C写的)。
====
[原创回答团]
第2个回答  推荐于2017-09-23
integer是整型的意思,但是C++里没有这个数据类型,只有int型,在java里有integer,Integer 是一个类,是对象类型 int是原始类型。本回答被提问者采纳
第3个回答  2011-03-06
integer英文意思“整数”
pascal,java,VB等等编程软件都把integer作数据类型
c++里的整型数据类型不是integer,是其缩写int。
实际编程时基本不会出现integer
第4个回答  2011-03-06
简单说来就是 int 的别名,再深层次个人觉得没太大必要知道

c++中的int和std分别是什么意思
C++中的int和std分别是数字类型以及库的意思。首先来讲解一下int函数。int是integer的缩写,是整数的意思,在变量赋值中代表将赋值的变量设定为整数类型。其次再讲一下std。它一般在using namespace std;中出现,说明没有这个库,所有函数要加上std::的前缀。所以这道题目的答案是整数类型和库。

int()是什么?
就是C++中类型初始化一个方法。就像定义一个类 class Integer { long value;public:Integer(long l){value = l;} };定义时候可以这样定义 Integer i(2);Integer i = Integer(2);都可以,第一种方法最常见,不用解释。第二种方法等价与 Integer temp(2);Integer i = temp;由于第二种方法需要...

...chal、 bool这些词都是什么意思,有怎样的联系
string 是学符串的意思;int 是整型数据类型;double 是实数型;char 是字符型变量;bool是逻辑变量

在计算机语言中int是什么意思
在计算机编程中,int是“integer”的缩写,代表整数类型。这是一种数据类型,用于存储整数,如正整数、零和负整数。整数类型在编程中非常常见,因为它们经常用于计数、计算和其他数学运算。2. int的特点 不同编程语言中的int可能有不同的位大小,但通常表示固定大小的二进制整数。例如,在许多现代编程语言...

integer和int有什么区别
integer:通常用于表示整数类型的变量或常量,是数学和编程中常见的概念。它是一个包含所有正整数、负整数和零的集合。在某些编程语言中,如Python和Java,integer是一个预定义的数据类型。它可以是内置数据类型或由程序员定义的类。它是数据类型的一个扩展分类。这意味着它包含了所有整数值的数据。它可以...

int和interger的区别
int:这是计算机编程中常用的整数数据类型,特别是在低级编程语言如C、C++、Java等中。它是一种基本的数据类型,用于存储整数。integer:这个词源于数学,用于表示一个完整的数,没有小数部分。在高级编程语言或者某些特定领域的应用中,如Python等,也存在integer类型,用于表示整数。2. 使用环境 int多出现...

int是什么意思汉语?
Int是英语中integer的缩写,表示整数。在计算机程序设计语言中,int表示整型变量,通常占用4个字节,范围为从-2147483648到2147483647。实际上,int是计算机程序设计中最常用的数据类型之一,无论是数值计算、条件判断还是循环等操作都需要使用int类型,因此它在程序设计中非常重要。Int数据类型的应用非常广泛,...

动int是什么意思?
动int是计算机术语中的一个常见词汇,int是integer的缩写,意为整数。在编程中,int通常用于定义整数类型的变量,可以存储从-2,147,483,648到2,147,483,647之间的整数值。动int是指声明或定义一个整型变量,例如在C++语言中,int a;就是声明一个整型变量a。在编程中,动int的应用非常广泛。int类型...

c++中_ttoi是什么英文的缩写?
(字符串)的意思,to 就是 英文 to 的意思 ,到 的 意思 ,i 是 integer , 整型.从 cstring 字符串 转换 为 int 64 或 32 的函数。int nCategories = _ttoi(szCategories);或 __int32 nCategories = _ttoi(szCategories);和 __int64 nCategories = _ttoi64(szCategories);

如何将integer转换成int
详细解释如下:在许多编程语言中,Integer 和 int 都是用来表示整数的数据类型。但它们之间存在一些细微的差异。通常,Integer 类型是为了支持更大范围的整数值而设计的,它可以包括正数、负数和零。而 int 类型通常具有固定的范围和大小。因此,在某些情况下,你可能需要将一个大的 Integer 值转换为较小...

相似回答