Стандарт C++ 98, страница 7

PDF-файл Стандарт C++ 98, страница 7 Практикум (Прикладное программное обеспечение и системы программирования) (37588): Другое - 4 семестрСтандарт C++ 98: Практикум (Прикладное программное обеспечение и системы программирования) - PDF, страница 7 (37588) - СтудИзба2019-05-09СтудИзба

Описание файла

PDF-файл из архива "Стандарт C++ 98", который расположен в категории "". Всё это находится в предмете "практикум (прикладное программное обеспечение и системы программирования)" из 4 семестр, которые можно найти в файловом архиве МГУ им. Ломоносова. Не смотря на прямую связь этого архива с МГУ им. Ломоносова, его также можно найти и в других разделах. .

Просмотр PDF-файла онлайн

Текст 7 страницы из PDF

[Example: the number twelve can be written 12,014, or 0XC. ]2The type of an integer literal depends on its form, value, and suffix. If it is decimal and has no suffix, it hasthe first of these types in which its value can be represented: int, long int; if the value cannot be represented as a long int, the behavior is undefined. If it is octal or hexadecimal and has no suffix, it has thefirst of these types in which its value can be represented: int, unsigned int, long int, unsignedlong int.

If it is suffixed by u or U, its type is the first of these types in which its value can be represented: unsigned int, unsigned long int. If it is suffixed by l or L, its type is the first of thesetypes in which its value can be represented: long int, unsigned long int. If it is suffixed by ul,lu, uL, Lu, Ul, lU, UL, or LU, its type is unsigned long int.3A program is ill-formed if one of its translation units contains an integer literal that cannot be representedby any of the allowed types.2.13.2 Character literalscharacter-literal:’c-char-sequence’L’c-char-sequence’c-char-sequence:c-charc-char-sequence c-charc-char:any member of the source character set exceptthe single-quote ’, backslash \, or new-line characterescape-sequenceuniversal-character-name__________________22) The digits 8 and 9 are not octal digits.16[lex.ccon]© ISO/IECISO/IEC 14882:1998(E)2 Lexical conventions2.13.2 Character literalsescape-sequence:simple-escape-sequenceoctal-escape-sequencehexadecimal-escape-sequencesimple-escape-sequence: one of\’ \" \? \\\a \b \f \n\r\t\voctal-escape-sequence:\ octal-digit\ octal-digit octal-digit\ octal-digit octal-digit octal-digithexadecimal-escape-sequence:\x hexadecimal-digithexadecimal-escape-sequence hexadecimal-digit1A character literal is one or more characters enclosed in single quotes, as in ’x’, optionally preceded bythe letter L, as in L’x’.

A character literal that does not begin with L is an ordinary character literal, alsoreferred to as a narrow-character literal. An ordinary character literal that contains a single c-char has typechar, with value equal to the numerical value of the encoding of the c-char in the execution character set.An ordinary character literal that contains more than one c-char is a multicharacter literal. A multicharacter literal has type int and implementation-defined value.2A character literal that begins with the letter L, such as L’x’, is a wide-character literal.

A wide-characterliteral has type wchar_t.23) The value of a wide-character literal containing a single c-char has valueequal to the numerical value of the encoding of the c-char in the execution wide-character set. The value ofa wide-character literal containing multiple c-chars is implementation-defined.3Certain nongraphic characters, the single quote ’, the double quote ", the question mark ?, and the backslash \, can be represented according to Table 5.Table 5—escape sequences_______________________________ new-lineNL (LF)\n horizontal tabHT\tVT\v vertical tabBS\b backspace carriage returnCR\r form feedFF\f alertBEL\a\\\ backslash?\? question mark single quote’\’ double quote"\" octal numberooo\ooo hex numberhhh\xhhh _______________________________The double quote " and the question mark ?, can be represented as themselves or by the escape sequences\" and \? respectively, but the single quote ’ and the backslash \ shall be represented by the escapesequences \’ and \\ respectively.

If the character following a backslash is not one of those specified, thebehavior is undefined. An escape sequence specifies a single character.__________________23) They are intended for character sets where a character does not fit into a single byte.17ISO/IEC 14882:1998(E)© ISO/IEC2.13.2 Character literals2 Lexical conventions4The escape \ooo consists of the backslash followed by one, two, or three octal digits that are taken to specify the value of the desired character.

The escape \xhhh consists of the backslash followed by x followedby one or more hexadecimal digits that are taken to specify the value of the desired character. There is nolimit to the number of digits in a hexadecimal sequence. A sequence of octal or hexadecimal digits is terminated by the first character that is not an octal digit or a hexadecimal digit, respectively. The value of acharacter literal is implementation-defined if it falls outside of the implementation-defined range definedfor char (for ordinary literals) or wchar_t (for wide literals).5A universal-character-name is translated to the encoding, in the execution character set, of the characternamed.

If there is no such encoding, the universal-character-name is translated to an implementationdefined encoding. [Note: in translation phase 1, a universal-character-name is introduced whenever anactual extended character is encountered in the source text. Therefore, all extended characters are describedin terms of universal-character-names. However, the actual compiler implementation may use its ownnative character set, so long as the same results are obtained. ]2.13.3 Floating literals[lex.fcon]floating-literal:fractional-constant exponent-partopt floating-suffixoptdigit-sequence exponent-part floating-suffixoptfractional-constant:digit-sequenceopt . digit-sequencedigit-sequence .exponent-part:e signopt digit-sequenceE signopt digit-sequencesign: one of+-digit-sequence:digitdigit-sequence digitfloating-suffix: one off l F1LA floating literal consists of an integer part, a decimal point, a fraction part, an e or E, an optionally signedinteger exponent, and an optional type suffix.

The integer and fraction parts both consist of a sequence ofdecimal (base ten) digits. Either the integer part or the fraction part (not both) can be omitted; either thedecimal point or the letter e (or E) and the exponent (not both) can be omitted. The integer part, theoptional decimal point and the optional fraction part form the significant part of the floating literal. Theexponent, if present, indicates the power of 10 by which the significant part is to be scaled.

If the scaledvalue is in the range of representable values for its type, the result is the scaled value if representable, elsethe larger or smaller representable value nearest the scaled value, chosen in an implementation-definedmanner. The type of a floating literal is double unless explicitly specified by a suffix. The suffixes f andF specify float, the suffixes l and L specify long double. If the scaled value is not in the range ofrepresentable values for its type, the program is ill-formed.18© ISO/IECISO/IEC 14882:1998(E)2 Lexical conventions2.13.4 String literals2.13.3 Floating literals[lex.string]string-literal:"s-char-sequenceopt"L"s-char-sequenceopt"s-char-sequence:s-chars-char-sequence s-chars-char:any member of the source character set exceptthe double-quote ", backslash \, or new-line characterescape-sequenceuniversal-character-name1A string literal is a sequence of characters (as defined in 2.13.2) surrounded by double quotes, optionallybeginning with the letter L, as in "..." or L"...".

A string literal that does not begin with L is an ordinary string literal, also referred to as a narrow string literal. An ordinary string literal has type “array of nconst char” and static storage duration (3.7), where n is the size of the string as defined below, and isinitialized with the given characters. A string literal that begins with L, such as L"asdf", is a wide stringliteral. A wide string literal has type “array of n const wchar_t” and has static storage duration, wheren is the size of the string as defined below, and is initialized with the given characters.2Whether all string literals are distinct (that is, are stored in nonoverlapping objects) is implementationdefined.

The effect of attempting to modify a string literal is undefined.3In translation phase 6 (2.1), adjacent narrow string literals are concatenated and adjacent wide string literalsare concatenated. If a narrow string literal token is adjacent to a wide string literal token, the behavior isundefined. Characters in concatenated strings are kept distinct. [Example:"\xA" "B"contains the two characters ’\xA’ and ’B’ after concatenation (and not the single hexadecimal character’\xAB’).

]4After any necessary concatenation, in translation phase 7 (2.1), ’\0’ is appended to every string literal sothat programs that scan a string can find its end.5Escape sequences and universal-character-names in string literals have the same meaning as in character literals (2.13.2), except that the single quote ’ is representable either by itself or by the escape sequence \’,and the double quote " shall be preceded by a \. In a narrow string literal, a universal-character-name maymap to more than one char element due to multibyte encoding. The size of a wide string literal is the totalnumber of escape sequences, universal-character-names, and other characters, plus one for the terminatingL’\0’. The size of a narrow string literal is the total number of escape sequences and other characters,plus at least one for the multibyte encoding of each universal-character-name, plus one for the terminating’\0’.2.13.5 Boolean literals[lex.bool]boolean-literal:falsetrue1The Boolean literals are the keywords false and true.

Such literals have type bool. They are not lvalues.19ISO/IEC 14882:1998(E)©(Blank page)20ISO/IEC© ISO/IECISO/IEC 14882:1998(E)3 Basic concepts3 Basic concepts3 Basic concepts[basic]1[Note: this clause presents the basic concepts of the C++ language. It explains the difference between anobject and a name and how they relate to the notion of an lvalue. It introduces the concepts of a declarationand a definition and presents C++’s notion of type, scope, linkage, and storage duration.

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