ARM VERSION 1.2 Datový list Strana 167

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 276
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 166
The C and C++ Libraries
ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-77
{
/* Your implementation of ferror */
return EOF;
}
void test(void)
{
printf("Hello world\n"); /* This works ... */
}
By default,
fread()
and
fwrite()
call fast block input/output functions that are part of
the ARM stream implementation. If you define your own
__FILE
structure instead of
using the ARM stream implementation,
fread()
and
fwrite()
will call
fgetc()
instead
of calling the block input/output functions. See also the implementation in
\Examples\Embedded\embed\retarget.c
.
fread(), fgets(), and gets()
The functions
fread()
,
fgets()
, and
gets()
are implemented as a loop over
fgetc()
and
ferror()
. Each uses the
FILE
argument opaquely.
If you provide your own implementation of
__FILE
,
__stdin
(for
gets()
),
fgetc()
, and
ferror()
, you can use these functions directly from the library.
Zobrazit stránku 166
1 2 ... 162 163 164 165 166 167 168 169 170 171 172 ... 275 276

Komentáře k této Příručce

Žádné komentáře