Chapter 16. Functions at a Glance

This chapter lists the functions in the standard library according to their respective areas of application, describing shared features of the functions and their relationships to one another. This compilation might help you to find the right function for your purposes while programming.


The individual functions are described in detail in Chapter 17, which explains them in alphabetical order, with examples.

Input and Output

We have dealt with this topic in detail in Chapter 13, which contains sections on I/O streams, sequential and random file access , formatted I/O, and error handling. A tabular list of the I/O functions will therefore suffice here. Table 16-1 lists general file access functions declared in the header stdio.h.

Table 16-1. General file access functions



Rename a file, delete a file

rename(), remove()

Create and/or open a file

fopen(), freopen(), tmpfile()

Close a file


Generate a unique filename


Query or clear file access flags

feof(), ferror(), clearerr()

Query the current file access position

ftell(), fgetpos()

Change the current file access position

rewind(), fseek(), fsetpos()

Write buffer contents to file


Control file buffering

setbuf(), setvbuf()

There are two complete sets of functions for input and output of characters and strings: the byte-character and the wide-character I/O functions (see "Byte-Oriented and Wide-Oriented Streams" in Chapter 13 for more information). The wide-character functions operate ...

Get C in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.