String.h: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Fstefani (discussione | contributi)
m piccole aggiunte
Riga 25:
! Name !! Notes
|-
|<code>void *[[memcpy]](void *dest, const void *src, size_t n);</code>
|Copia n bytes tra due aree di memoria che non devono sovrapporsi.
|-
|<code>void *[[memmove]](void *dest, const void *src, size_t n);</code>
|Copia n bytes tra due aree di memoria; a differenza di <code>memcpy</code> le aree di memoria possono sovrapporsi.
|-
|<code>void *[[memchr]](const void *s, int c, size_t n);</code>
|Ritorna un puntatore alla prima occorrenza di ''c'' in ''s'', o NULL se ''c'' non compare tra i primi ''n'' caratteri di ''s''.
|-
|<code>int [[memcmp]](const void *s1, const void *s2, size_t n);</code>
|Confronta i primi ''n'' caratteri di ''s1'' con ''s2''.
|-
|<code>void *[[memset]](void *s, int c, size_t n);</code>
|Colloca ''c'' nei primi ''n'' caratteri di ''s''.
|-
|<code>char *[[strcat]](char *dest, const char *src);</code>
|Concatena ''src'' alla stringa ''dest''.
|-
|<code>char *[[strncat]](char *dest, const char *src, size_t n);</code>
|Concatena al massimo ''n'' caratteri ''src'' alla stringa ''dest''.
|-
|<code>char *[[strchr]](const char *s, int c);</code>
|Restituisce un puntatore alla prima occorrenza di ''c'' in ''s''.
|-
|<code>char *[[strrchr]](const char *s, int c);</code>
|Restituisce un puntatore all'ultima occorrenza di ''c'' in ''s''.
|-
|<code>int [[strcmp]](const char *s1, const char *s2);</code>
|Confronta la stringa ''s1'' con ''s2''.
|-
|<code>int [[strncmp]](const char *, const char *, size_t);</code>
|Confronta al massimo ''n'' caratteri della stringa ''s1'' con ''s2''.
|-
<!--
|<code>int [[strcoll]](const char *, const char *);</code>
|compares two strings using the current [[locale]]'s [[collating order]]
|-
-->
|<code>char *[[strcpy]](char *s1, const char *s2);</code>
|Copia la stringa ''s2'' nella stringa ''s1'', incluso il carattere di terminazione ''\0''.
|-
|<code>char *[[strncpy]](char *s1, const char *s2, size_t n);</code>
|Copia al massimo ''n'' caratteri della stringa ''s2'' in ''s1''.
|-
|<code>char *[[strerror]](int n);</code>
|Restituisce un puntatore alla stringa che corrisponde all'errore ''n''.
|-
|<code>size_t [[strlen]](const char *s);</code>
|Restituisce la lunghezza della stringa ''s''.
|-
|<code>size_t [[strspn]](const char *s, const char *accept);</code>
|Restituisce la lunghezza della porzione iniziale della stringa ''s'' di lunghezza massima composta esattamente dai caratteri della stringa ''accept''
|-
|<code>size_t [[strcspn]](const char *s, const char *reject);</code>
|Restituisce la lunghezza della porzione iniziale della stringa ''s'' di lunghezza massima composta esattamente da caratteri diversi da quelli della stringa ''reject''
|-
|<code>char *[[strpbrk]](const char *s, const char *accept);</code>
|Restituisce la prima occorrenza di un carattere presente nella stringa ''s'' che sia uguale ad un qualsiasi carattere presente nella stringa ''accept''
|-
|<code>char *[[strstr]](const char *haystack, const char *needle);</code>
|Trova la prima occorrenza di needle all'interno di haystack
|-
|<code>char *[[strtok]](char *s, const char *delimiters);</code>
|Spezza la stringa ''s'' in una serie di stringhe chiamate [token] in corrispondenza dei carattere delimitatore ''delimiters''
|-
|}
<!--
|<code>size_t [[strxfrm]](char *dest, const char *src, size_t n);</code>
|transforms src into a collating form, such that the numerical sort order of the transformed string is equivalent to the collating order of src.
|}
Riga 102:
! Name !! Notes !! Specification
|-
|<code>char *[[strdup]](const char *);</code>
|allocates and duplicates a string into memory
|[[POSIX]]; originally a BSD extension
|-
|<code>errno_t [[strcpy_s]](char *restrict s1, rsize_t s1max, const char *restrict s2);</code>
|bounds-checked variant of <code>strcpy</code>
|ISO/IEC WDTR 24731
|-
|<code>void *[[mempcpy]](void *dest, const void *src, size_t n);</code>
|variant of <code>memcpy</code> returning a pointer to the byte following the last written byte
|[[GNU]]
|-
|<code>void *[[memccpy]](void *dest, const void *src, int c, size_t n
);</code>
|copies up to n bytes between two memory areas, which must not overlap, stopping when the byte c is found
|UNIX 98?
|-
|<code>int *[[strerror_r]](int, char *, size_t);</code>
|returns the string representation of [[errno]] (thread-safe; some differences in semantics between [[GNU]] and [[XSI]]/[[POSIX]])
|GNU, POSIX
|-
|<code>size_t [[strlcpy]](char *dest, const char *src, size_t n);</code>
|bounds-checked variant of <code>strcpy</code>
|originally [[OpenBSD]], now also [[FreeBSD]], [[Solaris Operating System|Solaris]], [[Mac OS X|OS X]]
|-
|<code>char *[[strtok_r]](char *, const char *, char **);</code>
|thread-safe version of strtok
|POSIX