11.07.2015 Views

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

SHOW MORE
SHOW LESS

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

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

Library FunctionsSCANF, VSCANFSynopsis#include int scanf (const char * fmt, ...)#include #include int vscanf (const char *, va_list ap)DescriptionThe scanf() function performs formatted input ("de-editing") from the stdin stream. Similar functionsare available for streams in general, and for strings. The function vscanf() is similar, but takesa pointer to an argument list rather than a series of additional arguments. This pointer should havebeen initialised with va_start().The input conversions are performed according to the fmt string; in general a character in theformat string must match a character in the input; however a space character in the format string willmatch zero or more "white space" characters in the input, i.e. spaces, tabs or newlines.A conversion specification takes the form of the character %, optionally followed by an assignmentsuppression character (’*’), optionally followed by a numerical maximum field width, followedby a conversion specification character. Each conversion specification, unless it incorporates the assignmentsuppression character, will assign a value to the variable pointed at by the next argument.Thus if there are two conversion specifications in the fmt string, there should be two additionalpointer arguments.The conversion characters are as follows:o x dSkip white space, then convert a number in base 8, 16 or 10 radix respectively. If a field width wassupplied, take at most that many characters from the input. A leading minus sign will be recognized.fSkip white space, then convert a floating number in either conventional or scientific notation. Thefield width applies as above.sSkip white space, then copy a maximal length sequence of non-white-space characters. The pointer189

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

Saved successfully!

Ooh no, something went wrong!