11.07.2015 Views

CrossWorks for ARM User Guide

CrossWorks for ARM User Guide

CrossWorks for ARM User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

•‘[’. Matches a nonempty sequence of characters from a set of expected characters(the scanset). The corresponding argument must be a pointer to the initial elementof a character array large enough to accept the sequence and a terminating nullcharacter, which will be added automatically. The conversion specifier includes allsubsequent characters in the <strong>for</strong>mat string, up to and including the matching rightbracket ‘]’. The charactersbetween the brackets (the scanlist) compose the scanset, unless the character afterthe left bracket is a circumflex ‘^’, in which case the scanset contains all charactersthat do not appear in the scanlist between the circumflex and the right bracket. Ifthe conversion specifier begins with ‘[]’ or‘[^]’, the right bracket character is inthe scanlist and the next following right bracket character is the matching rightbracket that ends the specification; otherwise the first following right bracketcharacter is the one that ends the specification. If a ‘-’ character is in the scanlistand is not the first, nor the second where the first character is a ‘^’, nor the lastcharacter, it is treated as a member of the scanset. Some <strong>CrossWorks</strong> libraryvariants do not support the ‘[’ conversion specifier in order to reduce code anddata space requirements; please ensure that you have selected the correct library inthe Scanf Classes Supported property of the project if you use this conversionspecifier.•‘p’. Reads a sequence output by the corresponding ‘%p’ <strong>for</strong>matted outputconversion. The corresponding argument must be a pointer to a pointer to void.•‘n’. No input is consumed. The corresponding argument shall be a pointer tosigned integer into which is to be written the number of characters read from theinput stream so far by this call to the <strong>for</strong>matted input function. Execution of a ‘%n’directive does not increment the assignment count returned at the completion ofexecution of the fscanf function. No argument is converted, but one is consumed.If the conversion specification includes an assignment-suppressing character or afield width, the behavior is undefined.•‘%’. Matches a single ‘%’ character; no conversion or assignment occurs.Note that the C99 width modifier ‘l’ used in conjuction with the ‘c’, ‘s’, and ‘[’conversion specifiers is not supported and nor are the conversion specifiers ‘a’ and ‘A’.getcharSynopsisDescriptionPortability#include int getchar(void);getchar reads a single character from the standard input stream.If the stream is at end-of-file or a read error occurs, getc returns EOF.getchar con<strong>for</strong>ms to ISO/IEC 9899:1990 (C90) and ISO/IEC 9899:1999 (C99).288 Chapter 28 Standard C Library Reference

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

Saved successfully!

Ooh no, something went wrong!