Formatted Output
printf(format_str, v1, v2,…) write to standard input.
fprintf(fp, format_str, v1, v2, …) write to a file
sprintf(str, format_str, v1, v2, …) write a string str.
- Where format_str is a string containing descriptor %code, the conversion code can be d (for integer), c (for character), s (for string), f (for floating point number), p (for addresses), etc.
- v1, v2, …, are variables (values) associated with each format descriptor.
- fp is file pointer.