August 1996
Intermediate to advanced
544 pages
9h 33m
English
The standard C library functions printf, fprintf, and vprintf format data for output, and sprintf and vsprintf format data into strings. These functions are called with a format string and a list of arguments whose values are to be formatted. Formatting is controlled by conversion specifiers of the form %c embedded in the format string; the ith occurrence of %c describes how to format the ith argument in the list of arguments that follow the format string. The other characters are copied verbatim. For example, if name is the string Array and count is 8,
sprintf(buf, "The %s interface has %d functions\n",
name, count)fills buf with the string "The Array interface has 8 functions\n", where \n denotes a new-line character, ...
Read now
Unlock full access