[mod.std.c] mod.std.c Digest V16#14

osd@hou2d.UUCP (Orlando Sotomayor-Diaz) (05/15/86)

From: Orlando Sotomayor-Diaz (The Moderator) <cbosgd!std-c>


mod.std.c Digest            Thu, 15 May 86       Volume 16 : Issue  14

Today's Topics:
         MORE C standard differences Apr85-Feb86, part 4 of 9
----------------------------------------------------------------------

Date: 
From: ihnp4!utzoo!lsuc!msb
Subject: MORE C standard differences Apr85-Feb86, part 4 of 9
To: utzoo!ihnp4!hou2d!osd

# D.9.6.2 The fscanf function

<--O   e,f,g   A floating point number is expected; the subsequent argu-
<--O           ment must be a pointer to floating.  The input format for
<--O           floating point numbers is an optionally  signed  sequence
<--O           of  digits, possibly containing a decimal point, followed
<--O           by an optional exponent field consisting of an E or an e,
<--O           followed by an optionally signed integer.

N-->   e,f,g   A floating point number is  expected;  the  corresponding
N-->           argument  shall be a pointer to floating.  The input for-
N-->           mat is as described for the strtod function.



# D.9.6.2 The fscanf function

       n       No input is consumed; the corresponding argument shall be
               a  pointer to integer into which is written the number of
               characters read from the input stream so far by this call
  *            to  fscanf.   {-->  This  is not counted as a match input
               item.}



# D.9.6.2 The fscanf function

<--O   If an invalid conversion specifier follows the %, the  result  is
<--O   undefined.

N-->   If the conversion specifier is a lower-case letter  that  is  not
N-->   described  above,  the  behavior is undefined.  If the conversion
N-->   specifier is any other character that is not described above, the
N-->   behavior is implementation-defined.



# D.9.6.2 The fscanf function

N-->   If end-of-file is encountered during a conversion, the conversion
N-->   terminates.



# D.9.6.2 The fscanf function

  *    The fscanf function  returns  the  number  of  input  items  {-->
       matched and} assigned ...



# D.9.6.6 The sscanf function

  *                int sscanf ({--> const} char *s,
                         const char *format, ...);



# D.9.6.7 The vfprintf function

N-->   The vfprintf function does not invoke the va_end function.

Remark:  And  likewise  for  vprintf  (#D.9.6.8)   and   vsprintf
(#D.9.6.9).



# D.9.7.1 The fgetc function

  *    If the stream is at end-of-file, {or --> the end-of-file  indica-
  *    tor  is  set and fgetc returns EOF.} If a read error occurs, {-->
       the error indicator is set and} fgetc returns EOF.

Remark: And likewise for getc (#D.9.7.5) and getchar (#D.9.7.6).



# D.9.7.3 The fputc function

  *    The fputc function returns the  character  written.   If  a  {-->
  *    write}  error  occurs, {--> the error indicator is set and} fputc
       returns EOF.

Remark: And likewise for putc (#D.9.7.8) and putchar (#D.9.7.9).



# D.9.7.11 The ungetc function

  *    The ungetc function pushes the  character  specified  by  c  {-->
       (converted  to  an  unsigned  char)}  back  onto the input stream
  *    pointed to by stream.  ...  An intervening {-->  fflush,}  fseek,
  *    {-->  or  rewind}  erases  any memory of a pushed-back character.
       ...

N-->   If the ungetc function is called twice on the same stream without
N-->   an  intervening  read, fflush, fseek, or rewind operation on that
N-->   stream, the behavior is undefined.

  *    ...  The ungetc function returns  {c  -->  the  character  pushed
  *    back}, or EOF {--> if the value of c equals that of the macro EOF
       or} if it cannot push the character back.



# D.9.8.1 The fread function

       The file position indicator  (if  defined)  is  advanced  by  the
  *    number of {bytes --> characters} successfully read.

Remark: A similar change  occurs  for  fwrite  (#D.9.8.3),  fseek
(#D.9.9.1), and ftell (#D.9.9.2).



# D.9.9.1 The fseek function

  *    The fseek function {--> clears the end-of-file indicator and} un-
       does any effects of ungetc.



# D.9.9.3 The rewind function

  *    ...  the {end-of-file and -->} error indicator is cleared ...



# D.9.10.4 The perror function

  *                {const char * --> void} perror (const char *s);



# D.9.10.4 The perror function

  *    {If s is not null, perror --> It} writes a line to  the  standard
  *    error  {file  -->  stream}  thus:  first {--> (if s is not a null
       pointer and the character pointed to by s is not the null charac-
       ter)},  the  string  pointed  to  by  s followed by a colon and a
  *    space; then an {--> appropriate} error message string followed by
       a new-line character.



# D.9.10.4 The perror function

  *    The contents of the error message strings are {-->  the  same  as
       those  returned  by  the  strerror  function with argument errno,
       which are} implementation-defined.



# D.9.10.4 The perror function

<--O   If the argument is a null pointer, the perror function returns  a
<--O   pointer to the message string and performs no output.

N-->   The perror function returns no value.

N-->   Forward references: the strerror function (#D.11.6.2).



# D.10 GENERAL UTILITIES <stdlib.h>

  *    The header <stdlib.h> declares {a --> three}  types  and  several
  *    functions of general utility {-->, and defines four macros}.

       The types declared are

       ...

N-->               idiv_t

N-->   which is a structure type that is the type of the value  returned
N-->   by the idiv function, and

N-->               ldiv_t

N-->   which is a structure type that is the type of the value  returned
N-->   by the ldiv function.

N-->   The macros defined are

N-->               EDOM ,
N-->               ERANGE ,

N-->   and

N-->               HUGE_VAL

N-->   which are described in #D.5.1; and

N-->               RAND_MAX

N-->   which expands to an integral constant expression,  the  value  of
N-->   which is the maximum value returned by the rand function.



# D.10.1 String conversion functions

<--O   Each of the functions described in this section  accepts  an  op-
<--O   tional  leading  sequence of white-space characters (as specified
<--O   by the isspace function) in the input string.



# D.10.1 String conversion functions

N-->   The function ans atof, atoi, and atol do not set errno on  error.
N-->   If the value of the result cannot be represented, the behavior is
N-->   undefined.



# D.10.1.1 The atof function

<--O   The function recognizes an optional sequence of white-space char-
<--O   acters,  then  an optional plus or minus sign, then a sequence of
<--O   digits optionally containing a decimal point,  then  an  optional
<--O   letter  e  or  E  followed  by an optionally signed integer.  The
<--O   first unrecognized character ends the conversion.  The string  is
<--O   interpreted by the same rules as for a floating constant.

N-->   Except for the behavior on error, it is equivalent to

N-->               strtod(nptr, (char **)NULL)

N-->   ...  Forward references: the strtod function (#D.10.1.4).

------------------------------

End of mod.std.c Digest - Thu, 15 May 86 13:30:27 EDT
******************************
USENET -> posting only through cbosgd!std-c.
ARPA -> ... through cbosgd!std-c@BERKELEY.ARPA (NOT to INFO-C)
In all cases, you may also reply to the author(s) above.