What input function is used to read a single character

Assignment Help Basic Computer Science
Reference no: EM13307204

1.       What header file may be used when reading input from a file and writing output to a file?

2.       How do you test for the end of an input file?

3.       Can fstream be used for both input and output?

4.       Explain each of the following flags:

a.       ios::app

b.      ios::ate

c.       ios::binary

d.      ios::in

e.      ios::out

f.        ios::trunc

5.       Declare an fstream object called infile, which opens the file input.txt for input.

6.       What is the difference between ifstreamand ofstream objects?

7.       What does the fail member function do?

8.       When a file stream object is passed to a function, should it be pass by reference?

9.       Explain the following bits used for error testing:

a.       ios::eofbit

b.      ios::failbit

c.       ios::hardfail

d.      ios::badbit

e.      ios::goodbit

10.   Explain the following member functions:

a.       eof()

b.      fail()

c.       bad()

d.      good()

e.      clear()

11.   What input function is used to read input including whitespace? Explain its format.

12.   What input function is used to read a single character?

13.   What output function is used to write a single character?

14.   Can you have more than one file open at a time?

15.   Give an example of opening an input file in binary mode.

16.   What functions are used instead of the >> and << operators when a file is in binary mode? What type of data do they expect?

17.   Give an example of using the read and write functions.

18.   How can the read and write functions be used on non-character data?

19.   For random access files, what is seekgand seekp?

20.   What arguments are required for seekg and seekp?

21.   Explain the following uses of seekg and seekp:

a.       infile.seekg(31L, ios::beg);

b.      outfile.seekp(-15L, ios::cur);

22.   Explain tellg and tellp. Give an example of using each.

23.   Can a file be opened for both input and output?

Reference no: EM13307204

Questions Cloud

The sequence an is defined : The sequence an is defined as follows: a0 = 9, an+1 = 3(an)^4 +4(an)^3 for n > 0. Show that a10 contains more than 1000 nines in decimal notation.
Hypothetical-generative-questionnaire and evaluative : DirectProtect is an insurance provider that uses telemarketers rather than insurance agents to sell its insurance and to deal with claims. It wants to introduce its product into new markets, but before it does so, it wants to have a prediction of how..
The shop ordered the same amount from ott : One month a shop ordered 95 total units from 3 different suppliers from Toronto, Ott., and Montreal. Costs were: $81, $49, and $57 with a total cost of $5375. The shop ordered the same amount from Ott and Toronto. How many did each order?
What is the speed of the package just as it reaches spring : A 2.0 ð‘˜ð‘" package is released on a frictionless ramp inclined 53.1 ° above the horizontal, What is the speed of the package just as it reaches the spring
What input function is used to read a single character : What functions are used instead of the >> and
Determine peak discharge if unit hydrograph is triangular : A hydrograph has a uniform rainfall intensity of 1.5 in/hr in the first hour, 2.0 in/hr in the second, and 0.75 in/hr in the third hour. Direct runoff (in inches) using the SCS method is 1.2in.
Determine the current through each bulb : For the third circuit, consisting of a single battery and two light bulbs in parallel, how does the brightness of the bulbs compare to the first circuit, What is the current through each bulb
Problem on kinematic chains : Assignment on kinematic chains - Type of chain whether it is locked,constrained or unconstrained?
Write a computer program that calculates the average : The following is a list of 20 exam scores. Write a computer program that calculates the average of the top 8 scores.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Itsec measurably show practical effectiveness of security

To what extent does ITSEC quantitatively and measurably illustrate practical effectiveness of the security measures it mandates?

  Designing a 4-to-16 decoder using not gates

Draw 4-to-16 decoder by using components. You must not use any extra components.

  Write a program that will read in a length in meters

Write a program that will read in a length in meters and centimeters and output the equivalent length in feet and inches. Use at least three functions; one for input, one or more for calculating and one for output.

  Write a java program that will print the words hello world

Write a java program that will print the words Hello World

  Why is the pcm sampling time

Radio Antennas work best when the diameter of the antenna is equal to the wave length of the radio wave. Reasonable antennas range from 1 cm to 5 meters in diameter. What frequency range does this cover?

  Explain why logic is an important part of oop

Logic is a key factor in laying out the processes for programming a game/application/website. Explain why logic is an important part of OOP.

  Plan for processing the potential crime incident scene

Describe your plan for processing the potential crime/incident scene. Some of the items you will want to cover include

  Find the greatest common divisor (gcd) of two integers

the greatest common divisor (GCD) of two integers is the largest integer that evenly divides each of the two numbers.Write method Gcd that returns the greatest common divisor of two integers.

  Write a program that creates a binary tree

Write a program that creates a Binary Tree from an array of integers, goes through it using inorder traversal (saving that to another array), then makes another balanced binary tree.

  Code scheme to meet marketing managers requirements

Design a code scheme that will meet the marketing managers stated requirements.

  Which dim statement would correctly declare an array

Which Dim statement would correctly declare an array of this structure for elements having subscripts from 0 through 30

  Write a method, insertat, that takes four parameters

write a method, insertAt, that takes four parameters: an array of integers; the length of the array; an integer, say insertItem; and an interger, say, index.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd