beautypg.com

String handling

Page 452

background image

Appendix B. C Standard Library

UM013037-1212

428

Zilog Developer Studio II – Z8 Encore!
User Manual

Integer Arithmetic

Miscellaneous

String Handling

The <

string.h

> header declares several functions useful for manipulating character

arrays and other objects treated as character arrays. Various methods are used for deter-
mining the lengths of arrays, but in all cases a char* or void* argument points to the initial
(lowest addressed) character of the array. If an array is written beyond the end of an object,
the behavior is undefined.

Type

Macro

Functions

The string-handling functions are listed and briefly described in the following sections:

Copying

– see page 429

Concatenation

– see page 429

Comparison

– see page 429

Search

– see page 429

Miscellaneous

– see page 430

int abs(int j);

Finds absolute value of integer value.

div_t div(int numer, int denom);

Computes integer quotient and remainder.

long int labs(long int j);

Finds absolute value of long integer value.

ldiv_t ldiv(long int numer, long int denom);

Computes long quotient and remainder.

void abort(void)

Abnormal program termination.

size_t

Unsigned integral type of the result of the sizeof
operator.

NULL

Expands to a null pointer constant.