Write a void function called copy_to_screen that copies the contents of a file to the screen. The argument of the function is an ifstream object. Preconditions and postconditions follow: Preconditions: The stream argument for the function has been connected to a file with a call to the member function open. Postcondition: The contents of the file connected to the ifstream argument have been copied to the screen so that the screen is the same as the contents of the file. This function does not close the file.

What will be an ideal response?


```
void copy_to_screen (ifstream& in)
{
char ch;
in.get(ch):
while( ! in.eof() )
{
cout << ch;
in.get(next);
}
}
Or just slightly simpler:
void copy_to_screen (ifstream& in)
{
char ch;
while( in.get(ch) )
cout << ch;
}
```

Computer Science & Information Technology

You might also like to view...

You perform a network ____________ to move virtual machine files from one host to another.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

________ are rules that are specific for each field in a table

A) Cardinality B) Integrity constraints C) Junctions D) Domain integrity constraints

Computer Science & Information Technology

An Access table is a database object you can use to enter, edit, or display data

Indicate whether the statement is true or false

Computer Science & Information Technology

Which wireless encryption standard is based on RC4 symmetric encryption and uses 64- or 128-bit encryption key?

a. WEP b. WPA c. WPA1 d. WPA2

Computer Science & Information Technology