text
stringlengths
0
99.6k
pow returns x**y.
sqrt returns the square root of x
--------------------------------------
ferror - check for error
feof - check for end of file
#include <stdio.h>
ferror()
feof(stream)
FILE stream;
ferror returns non-zero if an error
occurred during the last disk
operation, zero otherwise
feof returns non-zero if the specified
stream has reached end of file, zero
otherwise
--------------------------------------
floor, ceil, modf - get integer part
of float
#include <math.h>
float floor(x)
float x;
float ceil(x)
float x;
float modf(x,ptr)
float x, *ptr;
floor returns the greatest integer not
greater than x
ceil returns the least integer not
less than x
modf returns the positive fractional
part of x and stores the integer part
indirectly through ptr
--------------------------------------
fopen, freopen, fclose - open disk
file for i/o
#include <stdio.h>
FILE fopen(filename,mode)
char *filename,*mode;
FILE freopen(filename,mode,stream)
char *filename,*mode;
FILE stream;
fclose(stream)
FILE stream;
fopen opens a disk file file for
reading or writing. the string
filename contains the name of the file
and the first character of the string
mode specifies read or write ('r' or
'w'). the default file type is
sequential, but program file types may
selected. fopen returns a file number
(hearafter referred to as a stream)
which may be used in later i/o, or it
returns zero if the file cannot be
opened
freopen opens a file much the same as
fopen does. the file stream is first
closed, then if successful the old
stream is assigned to the new file.
this is useful to assign the constant
streams stdin and stdout to disk
files
ferror should be checked after every
fopen
fclose closes the specified file
--------------------------------------
fread, fwrite - array input/output
#include <stdio.h>
fread(ptr,elsize,nelem,stream)