06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

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.

fscanf pREPC+ <strong>System</strong> <strong>Calls</strong><br />

fscanf <strong>Read</strong>s formatted input from a stream.<br />

#include <br />

#include <br />

int fscanf(<br />

FILE *stream, /* stream pointer */<br />

const char *format, /* format control string */<br />

... /* arguments 1 through n */<br />

)<br />

Description<br />

Arguments<br />

The fscanf() function reads input from the stream specified by stream. As input<br />

is read, it is divided into input fields. An input field is defined as a string of nonwhite<br />

space characters. It extends either to the next white space character or up to<br />

a specified field width. The input fields are handled in a manner determined by a<br />

format control string. The input fields are converted to data items and stored in<br />

variables pointed to by the remaining arguments. If insufficient arguments are<br />

provided for format, the behavior is undefined. If format is exhausted while<br />

arguments remain, the excess arguments are evaluated but are otherwise ignored.<br />

stream Points to an open pREPC+ stream.<br />

format Points to the format control string. The format is a multibyte<br />

character sequence, beginning and ending with its initial shift state.<br />

It is composed of zero or more directives: one or more white-space<br />

characters; an ordinary multibyte character (neither % nor a whitespace<br />

character); or a conversion specification. Each conversion<br />

specification is introduced by the character %. After the %, the<br />

following appear in sequence:<br />

■ An optional assignment-suppressing character *.<br />

■ An optional nonzero decimal integer that specifies the maximum<br />

field width.<br />

3-56 <strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong>

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

Saved successfully!

Ooh no, something went wrong!