Jump to content

User:Goodwitc: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Goodwitc (talk | contribs)
No edit summary
Goodwitc (talk | contribs)
No edit summary
Line 6: Line 6:
''<b>blah</b>''
''<b>blah</b>''
=eat=
=eat=
{| class="wikitable"
|-
! Name||Notes
|-
!colspan=2 |File manipulation functions
|-
|<code>[[fclose]]</code> || closes a file associated with the FILE * value passed to it
|-
|<code>[[fopen|fopen, freopen, fdopen]]</code> || opens a file for certain types of reading or writing
|-
|<code>[[remove (C)|remove]]</code> || removes a file (deletes it)
|-
|<code>[[rename (C)|rename]]</code> || renames a file
|-
|<code>[[rewind (C)|rewind]]</code> || acts as if fseek(stream, 0L, SEEK_SET) was called for the stream passed, and then its error indicator cleared
|-
|<code>[[tmpfile]]</code> || creates and open a temporary file, which is deleted when closed with fclose()
|-
!colspan=2 |Input-output manipulation functions
|-
|<code>[[clearerr]]</code> || clears [[end-of-file]] and error indicators for a given stream
|-
|<code>[[feof]]</code> || checks whether an [[end-of-file]] indicator has been set for a given stream
|-
|<code>[[ferror]]</code> || checks whether an error indicator has been set for a given stream
|-
|<code>[[fflush]]</code> || forces any pending buffered '''output''' to be written to the file associated with a given stream
|-
|<code>[[fgetpos]]</code> || stores the file position indicator of the stream associated by its first argument (a FILE *) to its second argument (a fpos_t *)
|-
|<code>[[fgetc]]</code> || returns one character from a file
|-
|<code>[[fgets]]</code> || gets a string from the file (ending at newline or end-of-file)
|-
|<code>[[fputc]]</code> || writes one character to a file
|-
|<code>[[fputs]]</code> || writes a string to a file
|-
|<code>[[ftell]]</code> || returns a file-position indicator which can then be passed to [[fseek]]
|-
|<code>[[fseek]]</code> || seeks through a file
|-
|<code>[[fsetpos]]</code> || sets the file position indicator of a stream associated by its first argument (a FILE *) as stored in its second argument (a fpos_t *)
|-
|<code>[[fread]]</code> || reads data from a file
|-
|<code>[[fwrite]]</code> || writes data to a file
|-
|<code>[[getc]]</code> || reads and returns a character from a given stream and advances the file position indicator; it is allowed to be a macro with the same effects as [[fgetc]], except that it may evaluate the stream more than once
|-
|<code>[[getchar]]</code> || has the same effects as getc(stdin)
|-
|<code>[[gets]]</code> || reads characters from stdin until a newline is encountered and stores them in its only argument
|-
|<code>[[printf|printf, vprintf]]</code> || used to print to the standard output stream
|-
|<code>[[fprintf|fprintf, vfprintf]]</code> || used to print to a file
|-
|<code>[[sprintf|sprintf, snprintf, vsprintf]]</code> || used to print to a char array ([[C string]])
|-
|<code>[[perror]]</code> || writes an error message to stderr
|-
|<code>[[putc]]</code> || writes and returns a character to a stream and advances the file position indicator for it; it is allowed to be a macro with the same effects as [[fputc]], except that it may evaluate the stream more than once
|-
|<code>[[putchar|putchar, fputchar]]</code> || has the same effects as putc(stdout)
|-
|<code>[[scanf|scanf, vscanf]]</code> || used to input from the standard input stream
|-
|<code>[[fscanf|fscanf, vfscanf]]</code> || used to input from a file
|-
|<code>[[sscanf|sscanf, vsscanf]]</code> || used to input from a char array (e.g., a [[C string]])
|-
|<code>[[setbuf]]</code> ||
|-
|<code>[[setvbuf]]</code> || sets the buffering mode for a given stream
|-
|<code>[[tmpnam]]</code> || creates a temporary filename
|-
|<code>[[ungetc]]</code> || pushes a character back onto a stream
|-
|<code>[[puts_(C)|puts]]</code> || outputs a character string to stdout
|}

== Member constants ==
Constants defined in the <code>stdio.h</code> header include:
{| class="wikitable"
|-
! Name !! Notes
|-
|<code>[[End-of-file|EOF]]</code> || a negative integer of type <code>int</code> used to indicate end-of-file conditions
|-
|<code>BUFSIZ</code> || an integer which is the size of the buffer used by the <code>setbuf()</code> function
|-
|<code>FILENAME_MAX</code> || the size of a <code>char</code> array which is large enough to store the name of any file that can be opened
|-
|<code>FOPEN_MAX</code> || the number of files that may be open simultaneously; will be at least 8
|-
|<code>_IOFBF</code> || an abbreviation for "input/output fully buffered"; it is an integer which may be passed to the <code>setvbuf()</code> function to request ''block buffered'' input and output for an open stream
|-
|<code>_IOLBF</code> || an abbreviation for "input/output line buffered"; it is an integer which may be passed to the <code>setvbuf()</code> function to request ''line buffered'' input and output for an open stream
|-
|<code>_IONBF</code> || an abbreviation for "input/output not buffered"; it is an integer which may be passed to the <code>setvbuf()</code> function to request ''unbuffered'' input and output for an open stream
|-
|<code>L_tmpnam</code> || the size of a <code>char</code> array which is large enough to store a temporary filename generated by the <code>tmpnam()</code> function
|-
|<code>NULL</code> || a macro expanding to the [[null pointer]] constant; that is, a constant representing a pointer value which is guaranteed '''not''' to be a valid address of an object in memory
|-
|<code>SEEK_CUR</code> || an integer which may be passed to the <code>fseek()</code> function to request positioning relative to the current file position
|-
|<code>SEEK_END</code> || an integer which may be passed to the <code>fseek()</code> function to request positioning relative to the end of the file
|-
|<code>SEEK_SET</code> || an integer which may be passed to the <code>fseek()</code> function to request positioning relative to the beginning of the file
|-
|<code>TMP_MAX</code> || the maximum number of unique filenames generable by the <code>tmpnam()</code> function; will be at least 25
|}



[[Image:thumb.jpg |thumb]]
[[Image:thumb.jpg |thumb]]

Revision as of 18:57, 4 March 2009

goodwitc

My name is Goodwitc. You can find my site here.

what

blah

where

blah

eat

Name Notes
File manipulation functions
fclose closes a file associated with the FILE * value passed to it
fopen, freopen, fdopen opens a file for certain types of reading or writing
remove removes a file (deletes it)
rename renames a file
rewind acts as if fseek(stream, 0L, SEEK_SET) was called for the stream passed, and then its error indicator cleared
tmpfile creates and open a temporary file, which is deleted when closed with fclose()
Input-output manipulation functions
clearerr clears end-of-file and error indicators for a given stream
feof checks whether an end-of-file indicator has been set for a given stream
ferror checks whether an error indicator has been set for a given stream
fflush forces any pending buffered output to be written to the file associated with a given stream
fgetpos stores the file position indicator of the stream associated by its first argument (a FILE *) to its second argument (a fpos_t *)
fgetc returns one character from a file
fgets gets a string from the file (ending at newline or end-of-file)
fputc writes one character to a file
fputs writes a string to a file
ftell returns a file-position indicator which can then be passed to fseek
fseek seeks through a file
fsetpos sets the file position indicator of a stream associated by its first argument (a FILE *) as stored in its second argument (a fpos_t *)
fread reads data from a file
fwrite writes data to a file
getc reads and returns a character from a given stream and advances the file position indicator; it is allowed to be a macro with the same effects as fgetc, except that it may evaluate the stream more than once
getchar has the same effects as getc(stdin)
gets reads characters from stdin until a newline is encountered and stores them in its only argument
printf, vprintf used to print to the standard output stream
fprintf, vfprintf used to print to a file
sprintf, snprintf, vsprintf used to print to a char array (C string)
perror writes an error message to stderr
putc writes and returns a character to a stream and advances the file position indicator for it; it is allowed to be a macro with the same effects as fputc, except that it may evaluate the stream more than once
putchar, fputchar has the same effects as putc(stdout)
scanf, vscanf used to input from the standard input stream
fscanf, vfscanf used to input from a file
sscanf, vsscanf used to input from a char array (e.g., a C string)
setbuf
setvbuf sets the buffering mode for a given stream
tmpnam creates a temporary filename
ungetc pushes a character back onto a stream
puts outputs a character string to stdout

Member constants

Constants defined in the stdio.h header include:

Name Notes
EOF a negative integer of type int used to indicate end-of-file conditions
BUFSIZ an integer which is the size of the buffer used by the setbuf() function
FILENAME_MAX the size of a char array which is large enough to store the name of any file that can be opened
FOPEN_MAX the number of files that may be open simultaneously; will be at least 8
_IOFBF an abbreviation for "input/output fully buffered"; it is an integer which may be passed to the setvbuf() function to request block buffered input and output for an open stream
_IOLBF an abbreviation for "input/output line buffered"; it is an integer which may be passed to the setvbuf() function to request line buffered input and output for an open stream
_IONBF an abbreviation for "input/output not buffered"; it is an integer which may be passed to the setvbuf() function to request unbuffered input and output for an open stream
L_tmpnam the size of a char array which is large enough to store a temporary filename generated by the tmpnam() function
NULL a macro expanding to the null pointer constant; that is, a constant representing a pointer value which is guaranteed not to be a valid address of an object in memory
SEEK_CUR an integer which may be passed to the fseek() function to request positioning relative to the current file position
SEEK_END an integer which may be passed to the fseek() function to request positioning relative to the end of the file
SEEK_SET an integer which may be passed to the fseek() function to request positioning relative to the beginning of the file
TMP_MAX the maximum number of unique filenames generable by the tmpnam() function; will be at least 25