tags:
- school
- cs253
- computer-science
- programming
- c
- notes
source: https://man7.org/linux/man-pages/man3/printf.3.html
created: 2024-09-13
published: 2024-06-15
What are the ten functions in the printf()
family of functions?
The ten functions in the printf()
family of functions are:
printf()
.fprintf()
.dprintf()
.sprintf()
.snprintf()
.vprintf()
.vfprintf()
.vdprintf()
.vsprintf()
,vsnprintf()
.Which library provides the printf()
family of functions?
The library that provides the printf()
family of functions is the C standard library.
Which header provides the printf()
family of functions?
The header that provides the printf()
family of functions is stdio.h
.
What is the prototype of the printf()
function?
The prototype of the printf()
function is:
int printf(const char *restrict format, ...);
What is the prototype of the fprintf()
function?
The prototype of the fprintf()
function is:
int fprintf(FILE *restrict stream, const char *restrict format, ...);
What is the prototype of the dprintf()
function?
The prototype of the dprintf()
function is:
int dprintf(int fd, const char *restrict format, ...);
What is the prototype of the sprintf()
function?
The prototype of the sprintf()
function is:
int sprintf(char *restrict str, const char *restrict format, ...);
...
What do functions in the printf()
family of functions do?
Functions in the printf()
family of functions produce output according to a format.
Where do the printf()
and vprintf()
functions write to?
The printf()
and vprintf()
functions write to stdout.
Where do the fprintf()
and vfprintf()
functions write to?
The printf()
and vprintf()
functions write to a given output stream, stream
.
Where do the sprintf()
, snprintf()
, vsprintf()
, and vsnprintf()
functions write to?
The sprintf()
, snprintf()
, vsprintf()
, and vsnprintf()
functions write to a given character string, str
.
Where does the dprintf()
function write to?
The dprintf()
function writes to a file descriptor, fd
.
Where does the fprintf()
function write to?
The fprintf()
function writes to an stdio
stream.
What do the functions snprintf()
and vsnprintf()
write at most?
The functions snprintf()
and vsnprintf()
write at most size
bytes, including the null byte \0
.
What is the difference between printf()
functions that begin with v
and the other printf()
functions?
The difference between printf()
functions that begin with v
and the other printf()
functions is that they're called with va_list
instead of a variable number of arguments.
...