Главная » Просмотр файлов » Стандарт языка Си С99 TC

Стандарт языка Си С99 TC (1113411), страница 17

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

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

digitpp-numberpp-numberpp-numberpp-numberpp-numberpp-numberpp-numberdigitidentifier-nondigite signE signp signP sign.Description2A preprocessing number begins with a digit optionally preceded by a period (.) and maybe followed by valid identifier characters and the character sequences e+, e-, E+, E-,p+, p-, P+, or P-.3Preprocessing number tokens lexically include all floating and integer constant tokens.Semantics4A preprocessing number does not have type or a value; it acquires both after a successfulconversion (as part of translation phase 7) to a floating constant token or an integerconstant token.69) Thus, sequences of characters that resemble escape sequences cause undefined behavior.70) For an example of a header name preprocessing token used in a #pragma directive, see 6.10.9.§6.4.8Language65ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N12566.4.9 Comments1Except within a character constant, a string literal, or a comment, the characters /*introduce a comment.

The contents of such a comment are examined only to identifymultibyte characters and to find the characters */ that terminate it.71)2Except within a character constant, a string literal, or a comment, the characters //introduce a comment that includes all multibyte characters up to, but not including, thenext new-line character. The contents of such a comment are examined only to identifymultibyte characters and to find the terminating new-line character.3EXAMPLE"a//b"#include "//e"// */f = g/**//h;//\i();/\/ j();#define glue(x,y) x##yglue(/,/) k();/*//*/ l();m = n//**/o+ p;////////four-character string literalundefined behaviorcomment, not syntax errorequivalent to f = g / h;// part of a two-line comment// part of a two-line comment// syntax error, not comment// equivalent to l();// equivalent to m = n + p;71) Thus, /* ...

*/ comments do not nest.66Language§6.4.9WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC36.5 Expressions1An expression is a sequence of operators and operands that specifies computation of avalue, or that designates an object or a function, or that generates side effects, or thatperforms a combination thereof.2Between the previous and next sequence point an object shall have its stored valuemodified at most once by the evaluation of an expression.72) Furthermore, the prior valueshall be read only to determine the value to be stored.73)3The grouping of operators and operands is indicated by the syntax.74) Except as specifiedlater (for the function-call (), &&, ||, ?:, and comma operators), the order of evaluationof subexpressions and the order in which side effects take place are both unspecified.4Some operators (the unary operator ~, and the binary operators <<, >>, &, ^, and |,collectively described as bitwise operators) are required to have operands that haveinteger type.

These operators yield values that depend on the internal representations ofintegers, and have implementation-defined and undefined aspects for signed types.5If an exceptional condition occurs during the evaluation of an expression (that is, if theresult is not mathematically defined or not in the range of representable values for itstype), the behavior is undefined.6The effective type of an object for an access to its stored value is the declared type of theobject, if any.75) If a value is stored into an object having no declared type through anlvalue having a type that is not a character type, then the type of the lvalue becomes the72) A floating-point status flag is not an object and can be set more than once within an expression.73) This paragraph renders undefined statement expressions such asi = ++i + 1;a[i++] = i;while allowingi = i + 1;a[i] = i;74) The syntax specifies the precedence of operators in the evaluation of an expression, which is the sameas the order of the major subclauses of this subclause, highest precedence first.

Thus, for example, theexpressions allowed as the operands of the binary + operator (6.5.6) are those expressions defined in6.5.1 through 6.5.6. The exceptions are cast expressions (6.5.4) as operands of unary operators(6.5.3), and an operand contained between any of the following pairs of operators: groupingparentheses () (6.5.1), subscripting brackets [] (6.5.2.1), function-call parentheses () (6.5.2.2), andthe conditional operator ?: (6.5.15).Within each major subclause, the operators have the same precedence.

Left- or right-associativity isindicated in each subclause by the syntax for the expressions discussed therein.75) Allocated objects have no declared type.§6.5Language67ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N1256effective type of the object for that access and for subsequent accesses that do not modifythe stored value. If a value is copied into an object having no declared type usingmemcpy or memmove, or is copied as an array of character type, then the effective typeof the modified object for that access and for subsequent accesses that do not modify thevalue is the effective type of the object from which the value is copied, if it has one.

Forall other accesses to an object having no declared type, the effective type of the object issimply the type of the lvalue used for the access.7An object shall have its stored value accessed only by an lvalue expression that has one ofthe following types:76)— a type compatible with the effective type of the object,— a qualified version of a type compatible with the effective type of the object,— a type that is the signed or unsigned type corresponding to the effective type of theobject,— a type that is the signed or unsigned type corresponding to a qualified version of theeffective type of the object,— an aggregate or union type that includes one of the aforementioned types among itsmembers (including, recursively, a member of a subaggregate or contained union), or— a character type.8A floating expression may be contracted, that is, evaluated as though it were an atomicoperation, thereby omitting rounding errors implied by the source code and theexpression evaluation method.77) The FP_CONTRACT pragma in <math.h> provides away to disallow contracted expressions.

Otherwise, whether and how expressions arecontracted is implementation-defined.78)Forward references: the FP_CONTRACT pragma (7.12.2), copying functions (7.21.2).76) The intent of this list is to specify those circumstances in which an object may or may not be aliased.77) A contracted expression might also omit the raising of floating-point exceptions.78) This license is specifically intended to allow implementations to exploit fast machine instructions thatcombine multiple C operators.

As contractions potentially undermine predictability, and can evendecrease accuracy for containing expressions, their use needs to be well-defined and clearlydocumented.68Language§6.5WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC36.5.1 Primary expressionsSyntax1primary-expression:identifierconstantstring-literal( expression )Semantics2An identifier is a primary expression, provided it has been declared as designating anobject (in which case it is an lvalue) or a function (in which case it is a functiondesignator).79)3A constant is a primary expression.

Its type depends on its form and value, as detailed in6.4.4.4A string literal is a primary expression. It is an lvalue with type as detailed in 6.4.5.5A parenthesized expression is a primary expression. Its type and value are identical tothose of the unparenthesized expression. It is an lvalue, a function designator, or a voidexpression if the unparenthesized expression is, respectively, an lvalue, a functiondesignator, or a void expression.Forward references: declarations (6.7).6.5.2 Postfix operatorsSyntax1postfix-expression:primary-expressionpostfix-expression [ expression ]postfix-expression ( argument-expression-listopt )postfix-expression . identifierpostfix-expression -> identifierpostfix-expression ++postfix-expression -( type-name ) { initializer-list }( type-name ) { initializer-list , }79) Thus, an undeclared identifier is a violation of the syntax.§6.5.2Language69ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N1256argument-expression-list:assignment-expressionargument-expression-list , assignment-expression6.5.2.1 Array subscriptingConstraints1One of the expressions shall have type ‘‘pointer to object type’’, the other expression shallhave integer type, and the result has type ‘‘type’’.Semantics2A postfix expression followed by an expression in square brackets [] is a subscripteddesignation of an element of an array object.

The definition of the subscript operator []is that E1[E2] is identical to (*((E1)+(E2))). Because of the conversion rules thatapply to the binary + operator, if E1 is an array object (equivalently, a pointer to theinitial element of an array object) and E2 is an integer, E1[E2] designates the E2-thelement of E1 (counting from zero).3Successive subscript operators designate an element of a multidimensional array object.If E is an n-dimensional array (n ≥ 2) with dimensions i × j × . . . × k, then E (used asother than an lvalue) is converted to a pointer to an (n − 1)-dimensional array withdimensions j × . . .

× k. If the unary * operator is applied to this pointer explicitly, orimplicitly as a result of subscripting, the result is the pointed-to (n − 1)-dimensional array,which itself is converted into a pointer if used as other than an lvalue. It follows from thisthat arrays are stored in row-major order (last subscript varies fastest).4EXAMPLEConsider the array object defined by the declarationint x[3][5];Here x is a 3 × 5 array of ints; more precisely, x is an array of three element objects, each of which is anarray of five ints.

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

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

Список файлов книги

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