
33
returns a non-zero value.
_fwrite
Purpose
:
Use
_fwrite
to write a specified number of data itmes, each of a given
size, from a buffer to the current position in a file opened for buffered
output. The current position is updated after the write.
Syntax
:
size_t _fwrite(const void *buffer, size_t size, size_t count, _TFILE
*file_pointer);
Example call
:
numwrite = _fwrite(buffer, sizeof(char), 80, outfile);
Includes
:
#include
“
UserLib.h
"
Description
:
The _
fwrite
function writes
count
data items, each of
size
bytes, to
the file specified by the argument
file_pointer
, starting at the current
position. After the write operation is complete, the current position is
updated. The data to be written is in the buffer whose address is
passed to
_fwrite
in the argument
buffer
.
Returns
:
The
_fwrite
function returns the number of items it actually wrote.
DelFile
Purpose
:
Delete the file in Disc C.
Syntax
:
unsigned short DelFile(const char *path_name);
Example call
:
DelFile(“c:\\data\\order.dat”);
Includes
:
#include
“
UserLib.h
"
Description
:
The
DelFile
function can delete a file that is existed.If you want to
delete a file that is opened by
_fopen
function,pleace use the function
of
_fclose
to close the file first,that can avoid delete error.
Returns
:
It expresses that succeed in deleting to pass 0 back, not 0 value
represent and fail.
◆
Input and Output Routines
_printf
Purpose
:
Use _printf to write character strings and vlues of C variables,
formatted in a specified manner, to display screen.
Syntax
:
int _printf(const char *format_string, …);
Example call
:
_printf(“The product of %d and %d is %d\n”, x, y, x*y);
Include
:
#include
“
UserLib.h
"
Description
:
The
_printf
function accepts a variable number of arguments and
prints them out to display screen. The value of each argument is
formatted according to the codes embedded in the format
specification
format_string.
If the
format_string
does not contain a %
character (except for the pair %%, which appears as a single % in the
Содержание 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 ...