Please enable JavaScript.
Coggle requires JavaScript to display documents.
Input and Output (Line Input and Output (fgets reads an input line from a…
Input and Output
Line Input and Output
-
-
For output, the function fputs writes a string to a file:
It returns EOF if an error occurs, and non-negative if not.
Error Handling
The trouble is that if one of the files can't be
accessed for some reason, the diagnostic is printed at the end of the concatenated output.
-
Functions such as fclose(closes an open file). Exit produces an exit status in which closes the open files and show the error.
Formatted Output
-
Converts, formats, and prints its arguments on the standard output
-
Formatted Input
-
scanf reads characters from the standard input, interprets them according to the format, and stores the results through the remaining arguments.
scanf stops when it exhausts its format string, or when some input fails to match the control
specification.
File Access
-
-
Takes two arguments. First the name of the file. Second if it is going to be read or written. Writing on an existing file will cause that the past data is cleared.