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.

string according to the format specifiers. The format specifier character (%)<br />

used within the string indicates that a conversion specification is to be done and<br />

the value is to be saved into the corresponding argument variable. A %% will<br />

input a single %. Formatting rules for the format specifier as follows:<br />

If fscanf() is used, then the specified stream is used, where scanf() defaults to<br />

STDIN (the last USE RS232).<br />

Format:<br />

The format takes the generic form %nt. n is an option and may be 1-99<br />

specifying the field width, the number of characters to be inputted. t is the type<br />

and maybe one of the following:<br />

c<br />

s<br />

u<br />

Lu<br />

d<br />

Ld<br />

o<br />

Lo<br />

x or X<br />

Lx or LX<br />

i<br />

Matches a sequence of characters of the number specified by the<br />

field width (1 if no field width is specified). The corresponding<br />

argument shall be a pointer to the initial character of an array long<br />

enough to accept the sequence.<br />

Matches a sequence of non-white space characters. The<br />

corresponding argument shall be a pointer to the initial character<br />

of an array long enough to accept the sequence and a<br />

terminating null character, which will be added automatically.<br />

Matches an unsigned decimal integer. The corresponding<br />

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

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

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

Matches a signed decimal integer. The corresponding argument<br />

shall be a pointer to a signed integer.<br />

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

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

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

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

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

corresponding argument shall be a pointer to a long signed or<br />

unsigned integer.<br />

Matches a hexadecimal integer. The corresponding argument<br />

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

Matches a long hexadecimal integer. The corresponding<br />

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

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

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

186

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

Saved successfully!

Ooh no, something went wrong!