text
stringlengths
0
99.6k
--------------------------------------
puts, fputs - output a string
#include <stdio.h>
puts(s)
char *s;
fputs(s, stream)
char *s;
FILE stream;
Puts writes a NULL-terminated string
to the standard output. Puts outputs
a newline character after the string.
Fputs writes a NULL-terminated string
to the specified stream. Fputs does
not output a newline character.
--------------------------------------
qsort - general purpose sort
qsort(base, nel, elsize, comp)
char *base;
int (*comp)();
Qsort sorts an array beginning at
"base", containing number of elements
"nel", each of size "elsize". "Comp"
is a function pointer to a function
which compares elements. The function
"comp" must take two pointers to
elements of the array and return an
integer less than, equal to, or greater
than zero, as the first element is
less than, equal to, or greater than,
the second.
--------------------------------------
random, srandom
- random number generator
random();
srandom(seed);
Random returns a psuedo-random
integer. Srandom sets the state of
the random number generator. If
srandom is called twice with the same
seed the same sequence of random
numbers is generated.
--------------------------------------
scanf,fscanf,sscanf - formatted output
#include <stdio.h>
scanf(control [, arg] ...)
char *control;
fscanf(stream, control [, arg] ...)
FILE stream;
char *control;
sscanf(s, control [, arg] ...)
char *s, *control;
These functions read sequences of
characters, perform conversions
specified by the control string on
them, and store the converted values
indirectly through pointer arguments.
Scanf reads from the standard input,
fscanf reads from the specified
stream, and sscanf reads from the
string s.
The control string may contain blanks
and newlines, which may match
optional blanks and newlines from the
input, other ordinary characters,
wich must match corresponding
characters from the input, and
conversion specifiers.
Each conversion specifier begins with
a percent character (%) and is
followed by:
An optional star (*) which suppresses
assignment of the converted value.
An optional number which specifies
the maximum field width. Characters
are read up to the first unrecognized
character for the type of conversion
being performed or until the number