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

  Fluid mechanics

Consider a two-dimensional velocity ?eld V~ = aˆi + by2ˆj, where a = 1 m/s and b = 2 m?1s-1

  What types of decisions best suited for automated decision

What types of decisions are best suited for automated decision making?

  How do providing goods and services for government differ

How do providing goods and services for the government differ from providing goods and services for other organizations?

  Work with classes as reusable code

Objective: Work with classes as reusable code and random numbers. Instructions: A slot machine is a device that the user inserts money into and then pulls a lever (or presses a button).

  How old are they now

A good old-fashioned word problem. Don't forget use rref() and the backslash method to solve it. Peter is four times older than Mary. In four years, he will be two times older. How old are they now? How to solve using matlab?

  Draw an rea diagram-data modeling and database design

Data modeling and database design,  Draw an REA Diagram,  Draw an REA diagram for Sparky’s revenue cycle only. Be sure to include cardinalities. State any assumptions you had to make.

  Creating the walburg energy alternatives database

Complete In The Lab 2 - Creating the Walburg Energy Alternatives Database - on page AC 68 - AC 69 at the end of Access Chapter 1. Perform all steps. Submit the entire database file for grading.

  What do the terms syntactic sugar and syntactic salt mean

What do the terms "syntactic sugar" and "syntactic salt" mean? From your knowledge of the C# programming language, list at least five syntactic sugar and salt features.

  Adding two unsigned and signed binary numbers

Add the two binary numbers and interpret the sum assuming that the numbers are (1) unsigned, and (2) signed.

  Will action alter or destroy any historical and scientific

Will action alter or destroy any historical, scientific, or archaeological site? New engineering building project doesn't have any reported historical, scientific.

  What is the expected number of floors the elevator stops

A building has n floors numbered 1, 2, . . . , n, plus a ground floor G.

  Explain the operation of the mips andi instruction

Illustrate your answer with an appropriate example. In your answer you must provide details of the andi instruction format and of what each field in that instruction format does and how an andi instruction is identified.

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