Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 User Manual
Product codes
SW006021-1
Library Functions
2012 Microchip Technology Inc.
DS52053B-page 371
Example
#include <stdio.h>
#include <string.h>
void
main (void)
{
char * ptr;
char buf[] = "This is a string of words.";
char * sep_tok = ",?! "
ptr = strtok(buf, sep_tok);
while(ptr != NULL) {
printf("%s\n", ptr);
ptr = strtok(NULL, sep_tok);
}
}
Return Value
Returns a pointer to the first character of a token, or a null if no token was found.
Note
The separator string
s2
may be different from call to call.
TAN
Synopsis
#include <math.h>
double tan (double f)
Description
The
tan()
function calculates the tangent of
f
.
Example
#include <math.h>
#include <stdio.h>
#define C 3.141592/180.0
void
main (void)
{
double i;
for(i = 0 ; i <= 180.0 ; i += 10)
printf("tan(%3.0f) = %f\n", i, tan(i*C));
}
See Also
sin()
, cos(), asin(), acos(), atan(), atan2()
Return Value
The tangent of
f
.