Previous:Low-level file routines,
Up:Input and output
- What are the following?
- File name
- File descriptor
- What is a pseudo-device name?
- Where does
stdin usually get its input?
- Where does
stdout usually send its output?
- Write a program that simply prints out the following string to the
- Investigate what happens when you type the wrong conversion
specifier in a program. e.g. try printing an integer with
%f or a
floating point number with
%c. This is bound to go wrong - but how
will it go wrong?
- What is wrong with the following statements?
Hint: if you don't know, try them in a program!
printf ("Number = %d");
- What is a whitespace character?
- Write a program that aceepts two integers from the user,
multiplies them together, and prints the answer on your printer.
Try to make the input as safe as possible.
- Write a program that simply echoes all the input to the output.
- Write a program that strips all space characters out of the input and
replaces each string of them with a single newline character.
scanf function always takes pointer arguments. True or false?
- What is the basic difference between high-level and low-level file routines?
- Write a statement that opens a high level file for reading.
- Write a statement that opens a low level file for writing.
- Write a program that checks for illegal characters in text files. The
only valid characters are ASCII codes 10, 13, and 32..126.
- What statement performs formatted writing to text files?
- Poke around in the header files on your system so you can
see what is defined where.