Printf or print function in C takes a formatting string and couple of optional variables as input and outputs strings to console while converting input variables to strings. Header file contains type va_list and other variable argument utility macros to write these functions. ![]() Variadic functions should have at least one argument and after that "." should be added to indicate that this function takes variable arguments. To understand printf or scanf we need to first understand how Variadic functions work. Variadic functions can take a variable number of arguments. Printf and scanf functions are based on Variadic functions. ![]() These functions are adapted to work on different I/O buffer but they all work on the same principle. There are other variations of these functions.įprintf/fscanf operates on file buffer and sscanf/sprintf can operates on string buffer. These functions implicitly work on console stdin/stdout files. ![]() Printf and scanf are most frequently used in any programs written with C language. Print function in C abbreviated to printf() and scan function abbreviated to scanf.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |