17.02.2015 Views

CCS C Compiler Manual PCB / PCM / PCH

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

int compar(void *arg1,void *arg2) {<br />

if ( * (int *) arg1 < ( * (int *) arg2) return –1<br />

else if ( * (int *) arg1 == ( * (int *) arg2) return 0<br />

else return 1;<br />

}<br />

Example Files:<br />

Also See:<br />

ex_qsort.c<br />

bsearch()<br />

rand( )<br />

Syntax:<br />

Parameters:<br />

Returns:<br />

Function:<br />

Availability:<br />

Requires:<br />

re=rand()<br />

None<br />

A pseudo-random integer.<br />

The rand function returns a sequence of pseudo-random integers in the range<br />

of 0 to RAND_MAX.<br />

All devices<br />

#INCLUDE <br />

Examples:<br />

int I;<br />

I=rand();<br />

Example Files:<br />

Also See:<br />

None<br />

srand()<br />

rcv_buffer_bytes( )<br />

Syntax:<br />

Parameters:<br />

Returns:<br />

value = rcv_buffer_bytes([stream]);<br />

stream – optional parameter specifying the stream defined in #USE<br />

RS232.<br />

Number of bytes in receive buffer that still need to be retrieved.<br />

242

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!