Thread View: mod.std.c
1 messages
1 total messages
Started by Orlando Sotomayor-Diaz
Thu, 15 May 1986 17:32
mod.std.c Digest V16#17
Author: Orlando Sotomayor-Diaz
Date: Thu, 15 May 1986 17:32
Date: Thu, 15 May 1986 17:32
217 lines
7777 bytes
7777 bytes
From: Orlando Sotomayor-Diaz (The Moderator) <cbosgd!std-c>
mod.std.c Digest Thu, 15 May 86 Volume 16 : Issue 17
Today's Topics:
MORE C standard differences Apr85-Feb86, part 7 of 9
----------------------------------------------------------------------
Date:
From: ihnp4!utzoo!lsuc!msb
Subject: MORE C standard differences Apr85-Feb86, part 7 of 9
To: utzoo!ihnp4!hou2d!osd
# D.11.3.1 The strcat function
The strcat function appends a copy of the string pointed to by s2
* {--> (including the terminating null character)} to the end of
the string pointed to by s1.
# D.11.3.2 The strncat function
The strncat function appends not more than n characters of the
* string pointed to by s2 {--> (not including the terminating null
character)} to the end of the string pointed to by s1.
# D.11.3.2 The strncat function
N--> The number of characters that may end up in the array pointed to
N--> by s1 is strlen(s1)+n+1.
N--> Forward references: the strlen function (#D.11.6.3).
# D.11.4 {Length and -->} Comparison functions
# D.11.4.1 The memcmp function
N--> The contents of "holes" used as padding for purposes of alignment
N--> within structure objects are indeterminate, unless the contents
N--> of the entire object have been set explicitly by the calloc or
N--> memset function. Unions and strings shorter than their allocated
N--> space may also cause problems in comparison.
# D.11.5.1 The memchr function
* The memchr function locates the first occurrence of c {--> (con-
verted to an unsigned char)} in the initial n characters of the
object pointed to by s.
# D.11.5.2 The strchr function
* The strchr function locates the first occurrence of c {--> (con-
verted to a char)} in the string pointed to by s.
Remark: And the same change for strrchr (#D.11.5.5).
# {--> D.11.5.7 The strstr function}
N--> Synopsis
N--> #include <string.h>
N--> char *strstr(const char *s1, const char *s2);
N--> Description
N--> The strstr function locates the first occurrence of the string
N--> pointed to by s2 in the string pointed to by s1.
N--> Returns
N--> The strstr function returns a pointer to the located string, or a
N--> null pointer if the string is not found.
# {D.11.5.7 --> D.11.5.8} The strtok function
<--O The strtok function considers the string pointed to by s1 to con-
<--O sist of a sequence of zero or more text tokens separated by spans
<--O of one or more characters from the string pointed to by s2.
N--> A sequence of calls to the strtok function breaks the string
N--> pointed to by s1 into a sequence of tokens, each of which is del-
N--> imited by a character from the string pointed to by s2. The
N--> first call in the sequence has s1 as its first argument, and is
N--> followed by calls with a null pointer as their first argument.
The separator string pointed to by s2 may be different from call
to call.
N--> The first call in the sequence searches s1 for the first charac-
N--> ter that is NOT contained in the current separator string s2. If
N--> no such character is found, there are no tokens in s1, and the
N--> strtok function returns a null pointer. If such a character is
N--> found, it is the start of the first token.
N--> The strtok function then searches from there for a character that
N--> IS contained in the current separator string. If no such charac-
N--> ter is found, the current token extends to the end of the string
N--> pointed to by s1, and subsequent searches for a token will fail.
N--> If such a character is found, it is overwritten by a null charac-
N--> ter, which terminates the current token. The strtok function
N--> saves a pointer to the following character, from which the next
N--> search for a token will start.
N--> Each subsequent call, with a null pointer as the value of the
N--> first argument, starts searching from the saved pointer and
N--> behaves as described above.
<--O The first call to the strtok function returns a pointer to the
<--O initial character of the first token, and will have written a NUL
<--O character into s1 immediately following the returned token. Each
<--O subsequent call (with the value of the first argument null) re-
<--O turns a pointer to a subsequent token. When no token remains in
<--O s1, the strtok function returns a null pointer.
N--> The strtok function returns a pointer to the first character of a
N--> token, or a null pointer if there is no token.
# {D.11.5.7 --> D.11.5.8} The strtok function
N--> Example
N--> #include <string.h>
N--> static char str[] = "?a???b,,,#c";
N--> char *t;
N--> t = strtok(str, "?"); /* t points to the token "a" */
N--> t = strtok(NULL, ","); /* t points to the token "??b" */
N--> t = strtok(NULL, "#,"); /* t points to the token "c" */
N--> t = strtok(NULL, "?"); /* t is a null pointer */
# {--> D.11.6 Miscellaneous functions}
# {D.11.2.2 --> D.11.6.1} The memset function
* The memset function copies the value of c ({cast --> converted}
* to an unsigned char) into each of the first n {bytes --> charac-
ters} of the object pointed to by s.
# {--> D.11.6.2 The strerror function}
N--> Synopsis
N--> #include <string.h>
N--> char *strerror(int errnum);
N--> Description
N--> The strerror function maps the error number in errnum to an error
N--> message string.
N--> Returns
N--> The strerror function returns a pointer to the string, the con-
N--> tents of which are implementation-defined. The array pointed to
N--> is not modifiable by the program, but may be overwritten by a
N--> subsequent call to the strerror function.
# {D.11.4.3 --> D.11.6.3} the strlen function
The strlen function computes the length of the string pointed to
* by s {, not counting the terminating NUL character -->}. ...
* The strlen function returns the number of {initial -->} charac-
* ters {--> that precede the terminating null character}.
# D.12.1 Components of time
Many functions deal with a "calendar time" that represents the
* current date {--> (according to the Gregorian calendar)} and
time.
# D.12.1 Components of time
* int tm_mon; /* {month of the year -->
months since January} - [0, 11] */
...
* int tm_yday; /* {day of the year -->
days since January 1} - [0, 365] */
------------------------------
End of mod.std.c Digest - Thu, 15 May 86 13:32:04 EDT
******************************
USENET -> posting only through cbosgd!std-c.
ARPA -> ... through cbosgd!std-c@BERKELEY.ARPA (NOT to INFO-C)
In all cases, you may also reply to the author(s) above.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads