Главная » Просмотр файлов » Стандарт C++ 98

Стандарт C++ 98 (1119566), страница 17

Файл №1119566 Стандарт C++ 98 (Стандарт C++ 98) 17 страницаСтандарт C++ 98 (1119566) страница 172019-05-09СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 17)

The declared type of an array object might be anarray of incomplete class type and therefore incomplete; if the class type is completed later on in the translation unit, the array type becomes complete; the array type at those two points is the same type. Thedeclared type of an array object might be an array of unknown size and therefore be incomplete at one pointin a translation unit and complete later on; the array types at those two points (“array of unknown bound ofT” and “array of N T”) are different types. The type of a pointer to array of unknown size, or of a typedefined by a typedef declaration to be an array of unknown size, cannot be completed.

[Example:class X;extern X* xp;extern int arr[];typedef int UNKA[];UNKA* arrp;UNKA** arrpp;void foo(){xp++;arrp++;arrpp++;}struct X { int i; };int arr[10];X x;void bar(){xp = &x;arrp = &arr;xp++;arrp++;}// X is an incomplete type// xp is a pointer to an incomplete type// the type of arr is incomplete// UNKA is an incomplete type// arrp is a pointer to an incomplete type// ill-formed: X is incomplete// ill-formed: incomplete type// OK: sizeof UNKA* is known// now X is a complete type// now the type of arr is complete// OK; type is ‘‘pointer to X’’// ill-formed: different types// OK: X is complete// ill-formed: UNKA can’t be completed—end example]8[Note: the rules for declarations and expressions describe in which contexts incomplete types are prohibited.

]9An object type is a (possibly cv-qualified) type that is not a function type, not a reference type, and not avoid type.10Arithmetic types (3.9.1), enumeration types, pointer types, and pointer to member types (3.9.2), and cvqualified versions of these types (3.9.3) are collectively called scalar types. Scalar types, POD-struct types,POD-union types (clause 9), arrays of such types and cv-qualified versions of these types (3.9.3) are collectively called POD types.11If two types T1 and T2 are the same type, then T1 and T2 are layout-compatible types. [Note: Layoutcompatible enumerations are described in 7.2.

Layout-compatible POD-structs and POD-unions aredescribed in 9.2. ]__________________38) The size and layout of an instance of an incompletely-defined object type is unknown.52© ISO/IEC3 Basic concepts3.9.1 Fundamental typesISO/IEC 14882:1998(E)3.9.1 Fundamental types[basic.fundamental]1Objects declared as characters (char) shall be large enough to store any member of the implementation’sbasic 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 unsignedor signed. Plain char, signed char, and unsigned char are three distinct types. A char, asigned 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 ofthe object representation participate in the value representation.

For unsigned character types, all possiblebit 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 asigned char or an unsigned char; which one is implementation-defined.2There are four signed integer types: “signed char”, “short int”, “int”, and “long int.” In thislist, 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 areprovided to meet special needs.3For each of the signed integer types, there exists a corresponding (but different) unsigned integer type:“unsigned char”, “unsigned short int”, “unsigned int”, and “unsigned longint,” 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 typeis a subrange of the corresponding unsigned integer type, and the value representation of each corresponding signed/unsigned type shall be the same.4Unsigned integers, declared unsigned, shall obey the laws of arithmetic modulo 2 n where n is the number of bits in the value representation of that particular size of integer.41)5Type wchar_t is a distinct type whose values can represent distinct codes for all members of the largestextended character set specified among the supported locales (22.1.1). Type wchar_t shall have the samesize, signedness, and alignment requirements (3.9) as one of the other integral types, called its underlyingtype.6Values of type bool are either true or false.42) [Note: there are no signed, unsigned, short, orlong bool types or values.

] As described below, bool values behave as integral types. Values of typebool participate in integral promotions (4.5).7Types bool, char, wchar_t, and the signed and unsigned integer types are collectively called integraltypes.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.

]8There are three floating point types: float, double, and long double. The type double providesat least as much precision as float, and the type long double provides at least as much precision asdouble. The set of values of the type float is a subset of the set of values of the type double; the set__________________39) that is, large enough to contain any value in the range of INT_MIN and INT_MAX, as defined in the header <climits>.40) See 7.1.5.2 regarding the correspondence between types and the sequences of type-specifiers that designate them.41) This implies that unsigned arithmetic does not overflow because a result that cannot be represented by the resulting unsigned integer type is reduced modulo the number that is one greater than the largest value that can be represented by the resulting unsigned integer type.42) Using a bool value in ways described by this International Standard as ‘‘undefined,’’ such as by examining the value of an uninitialized automatic variable, might cause it to behave as if is neither true nor false.43) Therefore, enumerations (7.2) are not integral; however, enumerations can be promoted to int, unsigned int, long, orunsigned long, as specified in 4.5.44) A positional representation for integers that uses the binary digits 0 and 1, in which the values represented by successive bits areadditive, begin with 1, and are multiplied by successive integral power of 2, except perhaps for the bit with the highest position.(Adapted from the American National Dictionary for Information Processing Systems.)53ISO/IEC 14882:1998(E)3.9.1 Fundamental types© ISO/IEC3 Basic conceptsof 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 collectivelycalled arithmetic types. Specializations of the standard template numeric_limits (18.2) shall specifythe maximum and minimum values of each arithmetic type for an implementation.9The 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 operandof 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.

Характеристики

Тип файла
PDF-файл
Размер
2,05 Mb
Материал
Тип материала
Высшее учебное заведение

Список файлов учебной работы

Свежие статьи
Популярно сейчас
Почему делать на заказ в разы дороже, чем купить готовую учебную работу на СтудИзбе? Наши учебные работы продаются каждый год, тогда как большинство заказов выполняются с нуля. Найдите подходящий учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6392
Авторов
на СтудИзбе
307
Средний доход
с одного платного файла
Обучение Подробнее