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

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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