Define a function called sendLine that takes one argument that is an output stream. When called, sendLine reads one line of input from the keyboard and outputs the line to the output stream given as...



Define a function called sendLine that takes one argument that is an output


stream. When called, sendLine reads one line of input from the keyboard


and outputs the line to the output stream given as its argument. You should


be able to call your function using either cout or an output-file stream as


the argument to your function sendLine. (If the argument is an output-file


stream, then the stream is connected to a file before the function is called,


so sendLine will not open or close any files.) For example, the first of the


following calls to sendLine copies a line from the keyboard to the file


morestuf.dat, and the second copies a line from the keyboard to the screen:


ofstream fout;


fout.open("morestuf.dat");


cout <>


sendLine(fout);


sendLine(cout);

Nov 16, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here