Question: what is the difference between printf and sprintf?
Answer: sprintf writes formatted text to an array of char , as opposed to a stream. printf("format", args) is used to print the data onto the standard output which is often a computer monitor. sprintf(char *, "format", args) is like printf. ... The file pointer is the only addition to the syntax of printf.