17.02.2015 Views

CCS C Compiler Manual PCB / PCM / PCH

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Built-in Functions<br />

atoi( ) atol( ) atoi32( )<br />

Syntax:<br />

ivalue = atoi(string)<br />

or<br />

lvalue = atol(string)<br />

or<br />

i32value = atoi32(string)<br />

Parameters: string is a pointer to a null terminated string of characters.<br />

Returns:<br />

Function:<br />

ivalue is an 8 bit int.<br />

lvalue is a 16 bit int.<br />

i32value is a 32 bit int.<br />

Converts the string passed to the function into an int<br />

representation. Accepts both decimal and hexadecimal argument. If the<br />

result cannot be represented, the behavior is undefined.<br />

Availability: All devices<br />

Requires:<br />

Examples:<br />

#INCLUDE <br />

char string[10];<br />

int x;<br />

strcpy(string,"123");<br />

x = atoi(string);<br />

// x is now 123<br />

Example<br />

Files:<br />

Also See:<br />

input.c<br />

printf()<br />

bit_clear( )<br />

Syntax:<br />

Parameters:<br />

bit_clear(var, bit)<br />

var may be a any bit variable (any lvalue)<br />

bit is a number 0- 31 representing a bit number, 0 is the least significant<br />

bit.<br />

161

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

Saved successfully!

Ooh no, something went wrong!