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);
}
}
```

Computer Science & Information Technology

You might also like to view...

When Windows 8.1 connects to a new wireless network, it prompts you to decide whether you want to turn on sharing for that network. Selecting No, don't turn on sharing or connect to devices tells Windows 8.1 to configure the connection as a ________ network

Fill in the blank(s) with correct word

Computer Science & Information Technology

It is necessary to use proper capitalization when entering natural language phrases in Outlook.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology