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

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

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

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

Thus, the null-terminated output has beencompletely written if and only if the returned value is nonnegative and less than n.7.19.6.6 The sprintf functionSynopsis1#include <stdio.h>int sprintf(char * restrict s,const char * restrict format, ...);Description2The sprintf function is equivalent to fprintf, except that the output is written intoan array (specified by the argument s) rather than to a stream. A null character is writtenat the end of the characters written; it is not counted as part of the returned value. Ifcopying takes place between objects that overlap, the behavior is undefined.Returns3The sprintf function returns the number of characters written in the array, notcounting the terminating null character, or a negative value if an encoding error occurred.7.19.6.7 The sscanf functionSynopsis1#include <stdio.h>int sscanf(const char * restrict s,const char * restrict format, ...);Description2The sscanf function is equivalent to fscanf, except that input is obtained from astring (specified by the argument s) rather than from a stream.

Reaching the end of thestring is equivalent to encountering end-of-file for the fscanf function. If copyingtakes place between objects that overlap, the behavior is undefined.Returns3The sscanf function returns the value of the macro EOF if an input failure occursbefore any conversion. Otherwise, the sscanf function returns the number of inputitems assigned, which can be fewer than provided for, or even zero, in the event of anearly matching failure.§7.19.6.7Library291ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N12567.19.6.8 The vfprintf functionSynopsis1#include <stdarg.h>#include <stdio.h>int vfprintf(FILE * restrict stream,const char * restrict format,va_list arg);Description2The vfprintf function is equivalent to fprintf, with the variable argument listreplaced by arg, which shall have been initialized by the va_start macro (andpossibly subsequent va_arg calls).

The vfprintf function does not invoke theva_end macro.254)Returns3The vfprintf function returns the number of characters transmitted, or a negativevalue if an output or encoding error occurred.4EXAMPLEThe following shows the use of the vfprintf function in a general error-reporting routine.#include <stdarg.h>#include <stdio.h>void error(char *function_name, char *format, ...){va_list args;va_start(args, format);// print out name of function causing errorfprintf(stderr, "ERROR in %s: ", function_name);// print out remainder of messagevfprintf(stderr, format, args);va_end(args);}254) As the functions vfprintf, vfscanf, vprintf, vscanf, vsnprintf, vsprintf, andvsscanf invoke the va_arg macro, the value of arg after the return is indeterminate.292Library§7.19.6.8WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC37.19.6.9 The vfscanf functionSynopsis1#include <stdarg.h>#include <stdio.h>int vfscanf(FILE * restrict stream,const char * restrict format,va_list arg);Description2The vfscanf function is equivalent to fscanf, with the variable argument listreplaced by arg, which shall have been initialized by the va_start macro (andpossibly subsequent va_arg calls).

The vfscanf function does not invoke theva_end macro.254)Returns3The vfscanf function returns the value of the macro EOF if an input failure occursbefore any conversion. Otherwise, the vfscanf function returns the number of inputitems assigned, which can be fewer than provided for, or even zero, in the event of anearly matching failure.7.19.6.10 The vprintf functionSynopsis1#include <stdarg.h>#include <stdio.h>int vprintf(const char * restrict format,va_list arg);Description2The vprintf function is equivalent to printf, with the variable argument listreplaced by arg, which shall have been initialized by the va_start macro (andpossibly subsequent va_arg calls).

The vprintf function does not invoke theva_end macro.254)Returns3The vprintf function returns the number of characters transmitted, or a negative valueif an output or encoding error occurred.§7.19.6.10Library293ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N12567.19.6.11 The vscanf functionSynopsis1#include <stdarg.h>#include <stdio.h>int vscanf(const char * restrict format,va_list arg);Description2The vscanf function is equivalent to scanf, with the variable argument list replacedby arg, which shall have been initialized by the va_start macro (and possiblysubsequent va_arg calls). The vscanf function does not invoke the va_endmacro.254)Returns3The vscanf function returns the value of the macro EOF if an input failure occursbefore any conversion. Otherwise, the vscanf function returns the number of inputitems assigned, which can be fewer than provided for, or even zero, in the event of anearly matching failure.7.19.6.12 The vsnprintf functionSynopsis1#include <stdarg.h>#include <stdio.h>int vsnprintf(char * restrict s, size_t n,const char * restrict format,va_list arg);Description2The vsnprintf function is equivalent to snprintf, with the variable argument listreplaced by arg, which shall have been initialized by the va_start macro (andpossibly subsequent va_arg calls).

The vsnprintf function does not invoke theva_end macro.254) If copying takes place between objects that overlap, the behavior isundefined.Returns3The vsnprintf function returns the number of characters that would have been writtenhad n been sufficiently large, not counting the terminating null character, or a negativevalue if an encoding error occurred. Thus, the null-terminated output has beencompletely written if and only if the returned value is nonnegative and less than n.294Library§7.19.6.12WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC37.19.6.13 The vsprintf functionSynopsis1#include <stdarg.h>#include <stdio.h>int vsprintf(char * restrict s,const char * restrict format,va_list arg);Description2The vsprintf function is equivalent to sprintf, with the variable argument listreplaced by arg, which shall have been initialized by the va_start macro (andpossibly subsequent va_arg calls).

The vsprintf function does not invoke theva_end macro.254) If copying takes place between objects that overlap, the behavior isundefined.Returns3The vsprintf function returns the number of characters written in the array, notcounting the terminating null character, or a negative value if an encoding error occurred.7.19.6.14 The vsscanf functionSynopsis1#include <stdarg.h>#include <stdio.h>int vsscanf(const char * restrict s,const char * restrict format,va_list arg);Description2The vsscanf function is equivalent to sscanf, with the variable argument listreplaced by arg, which shall have been initialized by the va_start macro (andpossibly subsequent va_arg calls).

The vsscanf function does not invoke theva_end macro.254)Returns3The vsscanf function returns the value of the macro EOF if an input failure occursbefore any conversion. Otherwise, the vsscanf function returns the number of inputitems assigned, which can be fewer than provided for, or even zero, in the event of anearly matching failure.§7.19.6.14Library295ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N12567.19.7 Character input/output functions7.19.7.1 The fgetc functionSynopsis1#include <stdio.h>int fgetc(FILE *stream);Description2If the end-of-file indicator for the input stream pointed to by stream is not set and anext character is present, the fgetc function obtains that character as an unsignedchar converted to an int and advances the associated file position indicator for thestream (if defined).Returns3If the end-of-file indicator for the stream is set, or if the stream is at end-of-file, the endof-file indicator for the stream is set and the fgetc function returns EOF.

Otherwise, thefgetc function returns the next character from the input stream pointed to by stream.If a read error occurs, the error indicator for the stream is set and the fgetc functionreturns EOF.255)7.19.7.2 The fgets functionSynopsis1#include <stdio.h>char *fgets(char * restrict s, int n,FILE * restrict stream);Description2The fgets function reads at most one less than the number of characters specified by nfrom the stream pointed to by stream into the array pointed to by s. No additionalcharacters are read after a new-line character (which is retained) or after end-of-file.

Anull character is written immediately after the last character read into the array.Returns3The fgets function returns s if successful. If end-of-file is encountered and nocharacters have been read into the array, the contents of the array remain unchanged and anull pointer is returned. If a read error occurs during the operation, the array contents areindeterminate and a null pointer is returned.255) An end-of-file and a read error can be distinguished by use of the feof and ferror functions.296Library§7.19.7.2WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC37.19.7.3 The fputc functionSynopsis1#include <stdio.h>int fputc(int c, FILE *stream);Description2The fputc function writes the character specified by c (converted to an unsignedchar) to the output stream pointed to by stream, at the position indicated by theassociated file position indicator for the stream (if defined), and advances the indicatorappropriately.

If the file cannot support positioning requests, or if the stream was openedwith append mode, the character is appended to the output stream.Returns3The fputc function returns the character written. If a write error occurs, the errorindicator for the stream is set and fputc returns EOF.7.19.7.4 The fputs functionSynopsis1#include <stdio.h>int fputs(const char * restrict s,FILE * restrict stream);Description2The fputs function writes the string pointed to by s to the stream pointed to bystream. The terminating null character is not written.Returns3The fputs function returns EOF if a write error occurs; otherwise it returns anonnegative value.7.19.7.5 The getc functionSynopsis1#include <stdio.h>int getc(FILE *stream);Description2The getc function is equivalent to fgetc, except that if it is implemented as a macro, itmay evaluate stream more than once, so the argument should never be an expressionwith side effects.§7.19.7.5Library297ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N1256Returns3The getc function returns the next character from the input stream pointed to bystream.

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

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

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

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