Hi guys. Can u please help a beginner to understand, what is the difference between putchar and printf? And what is fgets? Ive seen people use fgets for strings inputted by user. What similarities does it have with scanf?
Essentially, the f versions are formatted, meaning that you can specify widths of the strings, the number of floating points in a float or double, etc. Being unfamiliar with the C I/O, I'm not positive, but it does look like putchar doesn't support any style of strings, it only supports type casting chars and direct int values.
The same can't be said about fgets though, as it reads a string from a file object. This can't be used with stdin, I don't believe, but will effectively read the first line from a file.