
32
turns.
Returns
:
If the file is opened successfully,
_fopenLookup
returns a pointer to
the file continuous space block. Actually, this is a pointer to the
location of continuous space block. In case of an error,
_fopenLookup
returns a NULL.
_fread
Purpose
:
Use
_fread
to read a specified number of data items, eachof a given
size, from the current position in a file opened for buffered input. The
current position is updated after the read.
Syntax
:
size_t _fread(const void *buffer, size_t size, size_t count, _TFILE
*file_pointer);
Example call
:
Numread = _fread(buffer, sizeof(char), 80, infile);
Includes
:
#include
“
UserLib.h
"
Description
:
The
fread
function reads
count
data items, each of
size
bytes, starting
at the current read position of the file specified by the argument
file_pointer
. After the read is complete, the current position is
updated. You must allocate storage for a buffer to hold the number of
bytes that you expect to read. This buffer is a pointer to a
void
data
type.
Returns
:
The
_fread
function returns the number of items it successfully read.
_fseek
Purpose
:
Use
_fseek
to move to a new position in a file opened for buffered
input/output.
Syntax
:
int _fseek(_TFILE *file_pointer, long offset, int origin);
Example call
:
_fseek(infile, 0, SEEK_SET); /* Go to the beginning */
Includes
:
#include
“
UserLib.h
"
The
fseek
function sets the current read or write position of the file
specified by the argument
file_pointer
to a new value indicated by
the arguments “off-set” and “origin”. The
“offset” is a long integer indicating how far away the new position is
from a specific location given in “origin”. The following table
explains the possible value of “origin”.
Origin Interpretation
SEEK_SET
SEEK_CUR
Beginning of file.
Current position in the file.
Description
:
Returns
:
When successful,
_fread
returns a zero. In case of error,
_fread
Содержание PT-10
Страница 4: ...3 Keyboard Wedge 99 System 101 Power 102 Other 102 ...
Страница 13: ...12 6 Development Flow Chart ...
Страница 53: ...52 Returns No returns Notes ...