beautypg.com

Memset function, Rand function – Zilog Z80380 User Manual

Page 76

background image

Library Functions

Run Time Environment

4–12

UM004001-COR1103

memset

FUNCTION

Header file statement:

#include

Syntax:

void *memset

(void *dest, int c, size_t count)

The memset function sets the first count bytes of dest to the character c.

Return Value

The memset function returns the value of dest.

rand

FUNCTION

Header file statement:

#include

Syntax:

int rand

(void);

The rand function returns a pseudorandom integer in the range 0 to RAND_MAX. The srand
routine can be used to seed the pseudorandom-number generator before calling rand.

Return Value

The rand function returns a pseudorandom number, as described above. There is no error
returned.

Parameter

Description

dest

Pointer to destination

c

Character to set

count

Number of characters