1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
erik [133]
3 years ago
11

Write the definition of a function named fscopy. This function can be safely passed two fstream objects, one opened for reading,

the other for writing. Assume that the input source is a text file consisting of a sequence of newline character-terminated lines. The function simply copies, line by line, the entire content of the data source associated with the first argument to the data target associated with the second argument. No value is returned.
Computers and Technology
1 answer:
diamong [38]3 years ago
6 0

Question:

Write the definition of a function named fscopy that does a line-by-line copy from one stream to another. This function can be safely passed two fstream objects, one opened for reading, the other for writing. In addition, it gets a bool argument that is true if the output lines are to be numbered, and another argument, an int that specifies line-spacing in the output.

Assume that the input source is a text file consisting of a sequence of newline character-terminated lines. The function copies, line by line, the entire content of the data source associated with the first argument to the data target associated with the second argument. It returns the number of lines read in. If it the third parameter, the bool is true, every line that is output is preceded by a 6-position field holding the line number (an integer) followed by a space and then the actual line. If the last argument, the int is 2 or more, it specifies the line spacing: for example, it is 3, there are two blank lines output after each line printed. These blank lines are NOT numbered.

Answer:

void fscopy(fstream &fsin, fstream &fsout)

{

string s;

getline(fsin, s, '\n');

while (!fsin.fail( ) )

{

fsout << s << endl;

getline(fsin, s, '\n');

}

}

You might be interested in
BRAINLIEST FOR CORRECT ANSWERS PLS HELP
koban [17]
Either A or B. I would go with A but It can actually be B
5 0
2 years ago
Read 2 more answers
Help please!! worth 10 pts! answer quick please!
WINSTONCH [101]

Answer:

it has helped the people of today by

1.helped the young generation with there homework

2.you can book an hotel through the internet

3.you can also book a plane ticket via the internet

4.it is easier to look to ur email message via the internet

4 0
3 years ago
Can someone please help me! It’s due Thursday!
Eva8 [605]

Answer:

if the input is zero the out put is 1

Explanation:

because if you think about it if the input was 1 the output would be zero

7 0
2 years ago
List 100 social media with functions​
olga55 [171]

Answer:

J

Explanation:

6 0
3 years ago
HELP I WILL GIVVE BRAINLY AND 15 POINTS
levacccp [35]

Answer:

Because someone was hittting the space bar in the message instead of typing letters and numbers

Explanation:

Because they were bored or it was a glitch

4 0
3 years ago
Other questions:
  • True or false words spelling and grammar check is always %100
    7·2 answers
  • When creating an input control (for example, a button) on a form the _____________ indicates the data that is contained in the n
    13·1 answer
  • Test Average and Grade
    12·1 answer
  • Translate I don't sing into Spanish​
    11·2 answers
  • Which type of computing device is best suited to having a digital pen as an input device?
    9·1 answer
  • Why should the drives be segregated in a computer?​
    15·1 answer
  • what would be the address of the cell, which is intersect of the second row and third column in a worksheet
    8·2 answers
  • ________ of Willa Catha present an unadorned picture oflife on the prairies of the Midwestern United States during the19th centu
    8·1 answer
  • Write a function findWithinThreshold that identifies the elements of a given array that are inside a threshold value. Takes the
    13·1 answer
  • I need help someone plz i need it fast ..........
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!