what are the differences between scanf() and fscanf()?
thanks
scanf reads from the standard input stream stdin. fscanf reads from the named input stream. sscanf reads from the character string s. Each function reads characters, interprets them according to a format, and stores the results in its arguments.
printf () function writes formatted data to screen. sprinf () function writes formatted output to string. scanf () function reads formatted data from keyboard. sscanf () function Reads formatted input from a string.
1 Answer. Explanation: The fscanf() is similar to the scanf() function, except that the first argument of fscanf() specifies a stream from which to read whereas scanf() can read from standard input.
scanf()
is exactly identical to fscanf()
with stdin
as the first argument.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With