06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

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

Except in the case of a % specifier, the input item (or, in the case of a<br />

%n directive, the count of input characters) is converted to a type<br />

appropriate to the conversion specifier. If the input item is not a<br />

matching sequence, the execution of the directive fails: this<br />

condition is a matching failure. Unless assignment suppression was<br />

indicated by a *, the result of the conversion is placed in the object<br />

pointed to by the first argument following the format argument that<br />

has not already received a conversion result. If this object does not<br />

have an appropriate type, or if the result of the conversion cannot be<br />

represented in the space provided, the behavior is undefined.<br />

The conversion specifier characters and their definitions are as<br />

follows:<br />

d, i An optionally signed decimal integer is expected. The<br />

corresponding argument should be a pointer to an integer.<br />

o An optionally signed octal integer is expected. The<br />

corresponding argument should be a pointer to an integer.<br />

u An optionally signed octal integer is expected. The<br />

corresponding argument should be a pointer to an unsigned<br />

long integer.<br />

x An optionally signed hexadecimal integer is expected. The<br />

corresponding argument should be a pointer to an integer.<br />

e,f,g An optionally signed floating-point number is expected. The<br />

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

p An unsigned hexadecimal number is expected. The<br />

corresponding argument should be a pointer to a pointer to<br />

void.<br />

s A sequence of non-white-space characters is expected. The<br />

corresponding argument should be a pointer to a character<br />

array large enough to accept the sequence and an added,<br />

terminating null character.<br />

c A sequence of characters is expected. The number of<br />

characters in the sequence should be equal to the field<br />

width. If the field width is not specified, one character is<br />

expected. The corresponding argument should be a pointer<br />

to a character array large enough to accept the sequence. A<br />

terminating null character is not added.<br />

3-58 <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!