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
WHAT IS MULTIMEDIA SUPPOSED TO MEAN ???
melisa1 [442]

Answer:

using more than one medium of expression or communication

3 0
2 years ago
Read 2 more answers
All of the following changes have created an urgent need for centralization except: Select one: a. The Internet boom inspired bu
kifflom [539]

All of the following changes have created an urgent need for centralization except The number of qualified software programmers and PC repair technicians is dwindling

<h3><u>Explanation:</u></h3>

When the processing tasks are carried out on a centralized server it refers to the Centralization. In this type of architecture all the computer systems will be connected to a single server in which all the computational work are performed. The client machines that are connected to the central server will get the resources for computing from the centralized server.

The main reasons for the purpose of centralization includes the following such as the development in the internet that required many computer networks, the basic functioning of the business in which the needed applications are fed on the intranets, the cost associated in the maintenance of personal computers on the single network.

3 0
3 years ago
What is true about the dilation?
madreJ [45]

Hey hey hey! I recently took the test and the answer is D | (• ◡•)|

7 0
2 years ago
Read 2 more answers
Which of the following was not important in the development of the internet?
lesantik [10]
D. Rise of NASA.Hope I helped.
8 0
3 years ago
Read 2 more answers
Select the correct answer.
zmey [24]

the answer should be the letter a

3 0
3 years ago
Read 2 more answers
Other questions:
  • Given the following code, what is output by the method call, mystery(6 * 8)?
    8·1 answer
  • ________ hackers break into systems for non-malicious reasons such as to test system security vulnerabilities. black-hat gray-ha
    10·1 answer
  • What element of a timeline helps to mark progress of the project?
    15·1 answer
  • nside of your organization that checks how often client machines access it. If a client machine hasn't accessed the server in th
    6·1 answer
  • An algorithm is defined as a well-ordered collection of unambiguous and effectively computable operations that when executed pro
    10·1 answer
  • Retrieve the names of employees who work on exactly one project that is controlled by their department. (It does not matter how
    7·1 answer
  • Write a program to read a list of exam scores given as integer percentages in the range 0-100. Display the total number of grade
    10·1 answer
  • Fill in the blank: _____ data are statistical and numerical facts about a project.
    15·2 answers
  • Why do my airpods keep disconnecting from my laptop
    8·2 answers
  • Patricia Works in a coffee shop and manages the inventory of items.for each item she needs to recover the quantity in stock and
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!