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
Which keyboard command would you use to navigate to the left adjacent cell in a worksheet?
guapka [62]

Answer:

Either scroll on a mouse or use the left arrow key.

I don't know if this is right.

3 0
3 years ago
Read 2 more answers
Generally speaking, what is a “best practice"?
miss Akunina [59]

Answer:

What’s up, I’m currently in this class, and I was wondering if it’s easy or hard?

Explanation:

3 0
3 years ago
You typed the word "weather" when you meant to type the word "whether." When will Writer or Word flag this as a misspelling or a
maria [59]

Answer:

It depends on the structure of the sentence.

Explanation:

This will be shown as grammatical mistake because both the spellings are correct. If we write the word weather instead of the whether, Ms word shows the grammatical mistake. This is because, if we want to write the word whether, we should use or in our sentence. Both of these words are comes together.

Example

I will take a leave whether its raining or not.

In above sentence, both whether and or comes together. If we write weather instead of whether it just show the grammatical mistake in the sentence.

4 0
3 years ago
Read 2 more answers
A media file refers to what kind of file? A. Clip art
prohojiy [21]

Waveform Audio (.wav) is a common file format. Created by Microsoft and IBM, WAV was one of the first audio file types developed for the PC. WAV files are defined as lossless, meaning that files are large and complete; nothing has been lost.

your answer will be

<h2><em><u>C; image</u></em></h2>
5 0
4 years ago
Read 2 more answers
Which of the following statements is not true about report styles?
Lina20 [59]

Answer:

The answer to the following question is the option "C".

Explanation:

In computer science, Report is a document that displays data in a standardized format. We can summarize the report orally but the complete reports are always given in documents. In report styles, we can select controls for formatting sources, select controls for the formatting of citations and it does not control the overall formatting of the report. So the incorrect statement to this question is "Use the Page Setup tab to choose a report style for your document".

3 0
3 years ago
Other questions:
  • Suppose you send data to the 11111111 11111111 11111111 11111111 ip address on an ipv4 network. to which device(s) are you trans
    15·1 answer
  • What is the function of the Status bar in Outlook 2010?
    9·1 answer
  • Assume you're running a query on your orders in the past year. You want to see how many orders were placed after May. What type
    5·1 answer
  • Jeanne writes a song, and Raul wants to perform
    6·2 answers
  • Assume that the following variables have been defined in a program: int x = 10; int y = 20; int z = 30; Write a cout statement t
    11·1 answer
  • You use the ____ button if you want to specify subtotals or other calculations within the wizard.
    12·1 answer
  • You receive an email from a woman claiming her father was poisoned by business associates, but before his passing placed 12 mill
    12·2 answers
  • The process of recording and reporting the financial data for a business is known as:
    6·2 answers
  • PLEASE HELP I WILL GIVE BRAINLIEST!!
    8·1 answer
  • Difference between software developer and software engineer.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!