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

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

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

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

The initial characterof s2 overwrites the null character at the end of s1. If copying takes place betweenobjects that overlap, the behavior is undefined.Returns3The strcat function returns the value of s1.7.21.3.2 The strncat functionSynopsis1#include <string.h>char *strncat(char * restrict s1,const char * restrict s2,size_t n);Description2The strncat function appends not more than n characters (a null character andcharacters that follow it are not appended) from the array pointed to by s2 to the end ofthe string pointed to by s1. The initial character of s2 overwrites the null character at theend of s1. A terminating null character is always appended to the result.270) If copying269) Thus, if there is no null character in the first n characters of the array pointed to by s2, the result willnot be null-terminated.270) Thus, the maximum number of characters that can end up in the array pointed to by s1 isstrlen(s1)+n+1.§7.21.3.2Library327ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N1256takes place between objects that overlap, the behavior is undefined.Returns3The strncat function returns the value of s1.Forward references: the strlen function (7.21.6.3).7.21.4 Comparison functions1The sign of a nonzero value returned by the comparison functions memcmp, strcmp,and strncmp is determined by the sign of the difference between the values of the firstpair of characters (both interpreted as unsigned char) that differ in the objects beingcompared.7.21.4.1 The memcmp functionSynopsis1#include <string.h>int memcmp(const void *s1, const void *s2, size_t n);Description2The memcmp function compares the first n characters of the object pointed to by s1 tothe first n characters of the object pointed to by s2.271)Returns3The memcmp function returns an integer greater than, equal to, or less than zero,accordingly as the object pointed to by s1 is greater than, equal to, or less than the objectpointed to by s2.7.21.4.2 The strcmp functionSynopsis1#include <string.h>int strcmp(const char *s1, const char *s2);Description2The strcmp function compares the string pointed to by s1 to the string pointed to bys2.Returns3The strcmp function returns an integer greater than, equal to, or less than zero,accordingly as the string pointed to by s1 is greater than, equal to, or less than the string271) The contents of ‘‘holes’’ used as padding for purposes of alignment within structure objects areindeterminate.

Strings shorter than their allocated space and unions may also cause problems incomparison.328Library§7.21.4.2WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC3pointed to by s2.7.21.4.3 The strcoll functionSynopsis1#include <string.h>int strcoll(const char *s1, const char *s2);Description2The strcoll function compares the string pointed to by s1 to the string pointed to bys2, both interpreted as appropriate to the LC_COLLATE category of the current locale.Returns3The strcoll function returns an integer greater than, equal to, or less than zero,accordingly as the string pointed to by s1 is greater than, equal to, or less than the stringpointed to by s2 when both are interpreted as appropriate to the current locale.7.21.4.4 The strncmp functionSynopsis1#include <string.h>int strncmp(const char *s1, const char *s2, size_t n);Description2The strncmp function compares not more than n characters (characters that follow anull character are not compared) from the array pointed to by s1 to the array pointed toby s2.Returns3The strncmp function returns an integer greater than, equal to, or less than zero,accordingly as the possibly null-terminated array pointed to by s1 is greater than, equalto, or less than the possibly null-terminated array pointed to by s2.7.21.4.5 The strxfrm functionSynopsis1#include <string.h>size_t strxfrm(char * restrict s1,const char * restrict s2,size_t n);Description2The strxfrm function transforms the string pointed to by s2 and places the resultingstring into the array pointed to by s1.

The transformation is such that if the strcmpfunction is applied to two transformed strings, it returns a value greater than, equal to, or§7.21.4.5Library329ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N1256less than zero, corresponding to the result of the strcoll function applied to the sametwo original strings. No more than n characters are placed into the resulting arraypointed to by s1, including the terminating null character. If n is zero, s1 is permitted tobe a null pointer. If copying takes place between objects that overlap, the behavior isundefined.Returns3The strxfrm function returns the length of the transformed string (not including theterminating null character). If the value returned is n or more, the contents of the arraypointed to by s1 are indeterminate.4EXAMPLE The value of the following expression is the size of the array needed to hold thetransformation of the string pointed to by s.1 + strxfrm(NULL, s, 0)7.21.5 Search functions7.21.5.1 The memchr functionSynopsis1#include <string.h>void *memchr(const void *s, int c, size_t n);Description2The memchr function locates the first occurrence of c (converted to an unsignedchar) in the initial n characters (each interpreted as unsigned char) of the objectpointed to by s.Returns3The memchr function returns a pointer to the located character, or a null pointer if thecharacter does not occur in the object.7.21.5.2 The strchr functionSynopsis1#include <string.h>char *strchr(const char *s, int c);Description2The strchr function locates the first occurrence of c (converted to a char) in thestring pointed to by s.

The terminating null character is considered to be part of thestring.Returns3The strchr function returns a pointer to the located character, or a null pointer if thecharacter does not occur in the string.330Library§7.21.5.2WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC37.21.5.3 The strcspn functionSynopsis1#include <string.h>size_t strcspn(const char *s1, const char *s2);Description2The strcspn function computes the length of the maximum initial segment of the stringpointed to by s1 which consists entirely of characters not from the string pointed to bys2.Returns3The strcspn function returns the length of the segment.7.21.5.4 The strpbrk functionSynopsis1#include <string.h>char *strpbrk(const char *s1, const char *s2);Description2The strpbrk function locates the first occurrence in the string pointed to by s1 of anycharacter from the string pointed to by s2.Returns3The strpbrk function returns a pointer to the character, or a null pointer if no characterfrom s2 occurs in s1.7.21.5.5 The strrchr functionSynopsis1#include <string.h>char *strrchr(const char *s, int c);Description2The strrchr function locates the last occurrence of c (converted to a char) in thestring pointed to by s.

The terminating null character is considered to be part of thestring.Returns3The strrchr function returns a pointer to the character, or a null pointer if c does notoccur in the string.§7.21.5.5Library331ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N12567.21.5.6 The strspn functionSynopsis1#include <string.h>size_t strspn(const char *s1, const char *s2);Description2The strspn function computes the length of the maximum initial segment of the stringpointed to by s1 which consists entirely of characters from the string pointed to by s2.Returns3The strspn function returns the length of the segment.7.21.5.7 The strstr functionSynopsis1#include <string.h>char *strstr(const char *s1, const char *s2);Description2The strstr function locates the first occurrence in the string pointed to by s1 of thesequence of characters (excluding the terminating null character) in the string pointed toby s2.Returns3The strstr function returns a pointer to the located string, or a null pointer if the stringis not found.

If s2 points to a string with zero length, the function returns s1.7.21.5.8 The strtok functionSynopsis1#include <string.h>char *strtok(char * restrict s1,const char * restrict s2);Description2A sequence of calls to the strtok function breaks the string pointed to by s1 into asequence of tokens, each of which is delimited by a character from the string pointed toby s2. The first call in the sequence has a non-null first argument; subsequent calls in thesequence have a null first argument.

The separator string pointed to by s2 may bedifferent from call to call.3The first call in the sequence searches the string pointed to by s1 for the first characterthat is not contained in the current separator string pointed to by s2. If no such characteris found, then there are no tokens in the string pointed to by s1 and the strtok function332Library§7.21.5.8WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC3returns a null pointer. If such a character is found, it is the start of the first token.4The strtok function then searches from there for a character that is contained in thecurrent separator string. If no such character is found, the current token extends to theend of the string pointed to by s1, and subsequent searches for a token will return a nullpointer. If such a character is found, it is overwritten by a null character, whichterminates the current token.

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

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

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

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