29.09.2001, 09:25
|
#8
|
|
Administrator
Registriert seit: 09.08.1999
Beiträge: 547
|
Zitat:
Original geschrieben von pirate man
bitte gscheid die frage gelesen
die 2 befehle waren nur ein beispiel
ich suche ein faq, wo alle grundbefehle beschrieben werden
kapiert??
|
so dum war der tip mit den man pages gar nicht... kapitel 3 der manpages erklaert die wichtigsten c-funktionen, und das gar nicht so schlecht -- alle parameter, ....
beispiel:
SCANF(3) Linux Programmer's Manual SCANF(3)
NAME
scanf, fscanf, sscanf, vscanf, vsscanf, vfscanf - input format conversion
SYNOPSIS
#include <stdio.h>
int scanf( const char *format, ...);
int fscanf( FILE *stream, const char *format, ...);
int sscanf( const char *str, const char *format, ...);
#include <stdarg.h>
int vscanf( const char *format, va_list ap);
int vsscanf( const char *str, const char *format, va_list ap);
int vfscanf( FILE *stream, const char *format, va_list ap);
DESCRIPTION
The scanf family of functions scans input according to a format as
described below. This format may contain conversion specifiers; the
results from such conversions, if any, are stored through the pointer
arguments. The scanf function reads input from the standard input stream
stdin, fscanf reads input from the stream pointer stream, and sscanf
reads its input from the character string pointed to by str.
The vfscanf function is analogous to vfprintf(3) and reads input from the
stream pointer stream using a variable argument list of pointers (see
stdarg(3). The vscanf function scans a variable argument list from the
standard input and the vsscanf function scans it from a string; these are
analogous to the vprintf and vsprintf functions respectively.
Each successive pointer argument must correspond properly with each suc*
cessive conversion specifier (but see `suppression' below). All conver*
sions are introduced by the % (percent sign) character. The format
string may also contain other characters. White space (such as blanks,
tabs, or newlines) in the format string match any amount of white space,
including none, in the input. Everything else matches only itself.
Scanning stops when an input character does not match such a format char*
acter. Scanning also stops when an input conversion cannot be made (see
below).
CONVERSIONS
Following the % character introducing a conversion there may be a number
of flag characters, as follows:
* Suppresses assignment. The conversion that follows occurs as
usual, but no pointer is used; the result of the conversion is
simply discarded.
a Indicates that the conversion will be s, the needed memory space
for the string will be malloc'ed and the pointer to it will be
assigned to the char pointer variable, which does not have to be
initialised before. This flag does not exist in ANSI C.
h Indicates that the conversion will be one of dioux or n and the
next pointer is a pointer to a short int (rather than int).
l Indicates either that the conversion will be one of dioux or n and
the next pointer is a pointer to a long int (rather than int), or
that the conversion will be one of efg and the next pointer is a
pointer to double (rather than float). Specifying two l flags is
equivalent to the L flag.
L Indicates that the conversion will be either efg and the next
pointer is a pointer to long double or the conversion will be
dioux and the next pointer is a pointer to long long. (Note that
long long is not an ANSI C type. Any program using this will not
be portable to all architectures).
....
|
|
|