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.

Built-in Functions<br />

Li<br />

f,g or e<br />

Matches a long signed or unsigned integer. The corresponding<br />

argument shall be a pointer to a long signed or unsigned integer.<br />

Matches a floating point number in decimal or exponential format.<br />

The corresponding argument shall be a pointer to a float.<br />

[ Matches a non-empty sequence of characters from a set of<br />

expected characters. The sequence of characters included in the<br />

set are made up of all character following the left bracket ([) up to<br />

the matching right bracket (]). Unless the first character after the<br />

left bracket is a ^, in which case the set of characters contain all<br />

characters that do not appear between the brackets. If a -<br />

character is in the set and is not the first or second, where the<br />

first is a ^, nor the last character, then the set includes all<br />

characters from the character before the - to the character after<br />

the -.<br />

For example, %[a-z] would include all characters from a to z in<br />

the set and %[^a-z] would exclude all characters from a to z from<br />

the set. The corresponding argument shall be a pointer to the<br />

initial character of an array long enough to accept the sequence<br />

and a terminating null character, which will be added<br />

automatically.<br />

n<br />

Assigns the number of characters read thus far by the call to<br />

scanf() to the corresponding argument. The corresponding<br />

argument shall be a pointer to an unsigned integer.<br />

An optional assignment-suppressing character (*) can be used<br />

after the format specifier to indicate that the conversion<br />

specification is to be done, but not saved into a corresponding<br />

variable. In this case, no corresponding argument variable<br />

should be passed to the scanf() function.<br />

A string composed of ordinary non-white space characters is<br />

executed by reading the next character of the string. If one of the<br />

inputted characters differs from the string, the function fails and<br />

exits. If a white-space character precedes the ordinary non-white<br />

space characters, then white-space characters are first read in<br />

until a non-white space character is read.<br />

White-space characters are skipped, except for the conversion<br />

specifiers [, c or n, unless a white-space character precedes the [<br />

or c specifiers.<br />

Availability:<br />

Requires:<br />

Examples:<br />

All Devices<br />

#USE RS232<br />

char name[2-];<br />

unsigned int8 number;<br />

signed int32 time;<br />

187

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

Saved successfully!

Ooh no, something went wrong!