
tan
7-57
Run-Time-Support Functions
Break String Into Token
strtok
Syntax
#include <string.h>
char *
strtok
(char *str1, const char *str2);
Defined in
strtok.c in rts.src
Description
Successive calls to the strtok function break str1 into a series of tokens, each
delimited by a character from str2. Each call returns a pointer to the next token.
The first call to strtok uses the string str1. Successive calls use a null pointer
as the first argument. The value of str2 can change at each invocation. It is im-
portant to note that str1 is altered by the strtok function.
Example
After the first invocation of strtok in the example below, the pointer stra points
to the string excuse\0 because strtok has inserted a null character where the
first space used to be. In the comments, the notation \0 represents the null
character.
char *stra = ”excuse me while I kiss the sky”;
char *ptr;
ptr =
strtok
(stra,” ”); /* ptr −−> ”excuse\0” */
ptr =
strtok
(0,” ”);
/* ptr −−> ”me\0”
*/
ptr =
strtok
(0,” ”);
/* ptr −−> ”while\0”
*/
Tangent
tan
Syntax
#include <math.h>
double
tan
(double x);
Defined in
tan.c in rts.src
Description
The tan function returns the tangent of a floating-point number x. The angle
x is expressed in radians. An argument with a large magnitude may produce
a result with little or no significance.
Example
double x, y;
x = 3.1415927/4.0;
y = tan(x);
/* return value = 1.0 */
Содержание TMS320C2x
Страница 8: ...viii...
Страница 69: ...2 47 C Compiler Description...
Страница 159: ...6 36...
Страница 226: ...8 6...
Страница 250: ...Index Index 14 Z z shell option 2 2 2 4 2 14 overriding with c option 4 5 overriding with n option 2 13...