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

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

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

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

The contents of the newobject shall be the same as that of the old object prior to deallocation, up to the lesser ofthe new and old sizes. Any bytes in the new object beyond the size of the old object haveindeterminate values.3If ptr is a null pointer, the realloc function behaves like the malloc function for thespecified size. Otherwise, if ptr does not match a pointer earlier returned by thecalloc, malloc, or realloc function, or if the space has been deallocated by a callto the free or realloc function, the behavior is undefined. If memory for the newobject cannot be allocated, the old object is not deallocated and its value is unchanged.Returns4The realloc function returns a pointer to the new object (which may have the samevalue as a pointer to the old object), or a null pointer if the new object could not beallocated.314Library§7.20.3.4WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC37.20.4 Communication with the environment7.20.4.1 The abort functionSynopsis1#include <stdlib.h>void abort(void);Description2The abort function causes abnormal program termination to occur, unless the signalSIGABRT is being caught and the signal handler does not return.

Whether open streamswith unwritten buffered data are flushed, open streams are closed, or temporary files areremoved is implementation-defined. An implementation-defined form of the statusunsuccessful termination is returned to the host environment by means of the functioncall raise(SIGABRT).Returns3The abort function does not return to its caller.7.20.4.2 The atexit functionSynopsis1#include <stdlib.h>int atexit(void (*func)(void));Description2The atexit function registers the function pointed to by func, to be called withoutarguments at normal program termination.Environmental limits3The implementation shall support the registration of at least 32 functions.Returns4The atexit function returns zero if the registration succeeds, nonzero if it fails.Forward references: the exit function (7.20.4.3).7.20.4.3 The exit functionSynopsis1#include <stdlib.h>void exit(int status);Description2The exit function causes normal program termination to occur.

If more than one call tothe exit function is executed by a program, the behavior is undefined.§7.20.4.3Library315ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N12563First, all functions registered by the atexit function are called, in the reverse order oftheir registration,262) except that a function is called after any previously registeredfunctions that had already been called at the time it was registered. If, during the call toany such function, a call to the longjmp function is made that would terminate the callto the registered function, the behavior is undefined.4Next, all open streams with unwritten buffered data are flushed, all open streams areclosed, and all files created by the tmpfile function are removed.5Finally, control is returned to the host environment.

If the value of status is zero orEXIT_SUCCESS, an implementation-defined form of the status successful termination isreturned. If the value of status is EXIT_FAILURE, an implementation-defined formof the status unsuccessful termination is returned. Otherwise the status returned isimplementation-defined.Returns6The exit function cannot return to its caller.7.20.4.4 The _Exit functionSynopsis1#include <stdlib.h>void _Exit(int status);Description2The _Exit function causes normal program termination to occur and control to bereturned to the host environment. No functions registered by the atexit function orsignal handlers registered by the signal function are called.

The status returned to thehost environment is determined in the same way as for the exit function (7.20.4.3).Whether open streams with unwritten buffered data are flushed, open streams are closed,or temporary files are removed is implementation-defined.Returns3The _Exit function cannot return to its caller.262) Each function is called as many times as it was registered, and in the correct order with respect toother registered functions.316Library§7.20.4.4WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC37.20.4.5 The getenv functionSynopsis1#include <stdlib.h>char *getenv(const char *name);Description2The getenv function searches an environment list, provided by the host environment,for a string that matches the string pointed to by name.

The set of environment namesand the method for altering the environment list are implementation-defined.3The implementation shall behave as if no library function calls the getenv function.Returns4The getenv function returns a pointer to a string associated with the matched listmember. The string pointed to shall not be modified by the program, but may beoverwritten by a subsequent call to the getenv function. If the specified name cannotbe found, a null pointer is returned.7.20.4.6 The system functionSynopsis1#include <stdlib.h>int system(const char *string);Description2If string is a null pointer, the system function determines whether the hostenvironment has a command processor.

If string is not a null pointer, the systemfunction passes the string pointed to by string to that command processor to beexecuted in a manner which the implementation shall document; this might then cause theprogram calling system to behave in a non-conforming manner or to terminate.Returns3If the argument is a null pointer, the system function returns nonzero only if acommand processor is available. If the argument is not a null pointer, and the systemfunction does return, it returns an implementation-defined value.§7.20.4.6Library317ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N12567.20.5 Searching and sorting utilities1These utilities make use of a comparison function to search or sort arrays of unspecifiedtype. Where an argument declared as size_t nmemb specifies the length of the arrayfor a function, nmemb can have the value zero on a call to that function; the comparisonfunction is not called, a search finds no matching element, and sorting performs norearrangement.

Pointer arguments on such a call shall still have valid values, as describedin 7.1.4.2The implementation shall ensure that the second argument of the comparison function(when called from bsearch), or both arguments (when called from qsort), arepointers to elements of the array.263) The first argument when called from bsearchshall equal key.3The comparison function shall not alter the contents of the array. The implementationmay reorder elements of the array between calls to the comparison function, but shall notalter the contents of any individual element.4When the same objects (consisting of size bytes, irrespective of their current positionsin the array) are passed more than once to the comparison function, the results shall beconsistent with one another. That is, for qsort they shall define a total ordering on thearray, and for bsearch the same object shall always compare the same way with thekey.5A sequence point occurs immediately before and immediately after each call to thecomparison function, and also between any call to the comparison function and anymovement of the objects passed as arguments to that call.7.20.5.1 The bsearch functionSynopsis1#include <stdlib.h>void *bsearch(const void *key, const void *base,size_t nmemb, size_t size,int (*compar)(const void *, const void *));Description2The bsearch function searches an array of nmemb objects, the initial element of whichis pointed to by base, for an element that matches the object pointed to by key.

The263) That is, if the value passed is p, then the following expressions are always nonzero:((char *)p - (char *)base) % size == 0(char *)p >= (char *)base(char *)p < (char *)base + nmemb * size318Library§7.20.5.1WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC3size of each element of the array is specified by size.3The comparison function pointed to by compar is called with two arguments that pointto the key object and to an array element, in that order. The function shall return aninteger less than, equal to, or greater than zero if the key object is considered,respectively, to be less than, to match, or to be greater than the array element.

The arrayshall consist of: all the elements that compare less than, all the elements that compareequal to, and all the elements that compare greater than the key object, in that order.264)Returns4The bsearch function returns a pointer to a matching element of the array, or a nullpointer if no match is found. If two elements compare as equal, which element ismatched is unspecified.7.20.5.2 The qsort functionSynopsis1#include <stdlib.h>void qsort(void *base, size_t nmemb, size_t size,int (*compar)(const void *, const void *));Description2The qsort function sorts an array of nmemb objects, the initial element of which ispointed to by base.

The size of each object is specified by size.3The contents of the array are sorted into ascending order according to a comparisonfunction pointed to by compar, which is called with two arguments that point to theobjects being compared. The function shall return an integer less than, equal to, orgreater than zero if the first argument is considered to be respectively less than, equal to,or greater than the second.4If two elements compare as equal, their order in the resulting sorted array is unspecified.Returns5The qsort function returns no value.264) In practice, the entire array is sorted according to the comparison function.§7.20.5.2Library319ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N12567.20.6 Integer arithmetic functions7.20.6.1 The abs, labs and llabs functionsSynopsis1#include <stdlib.h>int abs(int j);long int labs(long int j);long long int llabs(long long int j);Description2The abs, labs, and llabs functions compute the absolute value of an integer j.

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

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

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

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