Question
1) write a c++ statement to accomplish each of the following: a) Writes a C-string stored in char* cStr to ostringstream iss. b) Safely reads
1) write a c++ statement to accomplish each of the following:
a) Writes a C-string stored in char* cStr to ostringstream iss.
b) Safely reads a line of text from cin into char cStr[128] until a 'Q' is encountered and discarded.
c) Writes all numeric values to the file fout using exactly 8 decimal places of precision.
d) Which of the following statement restores the default fill character?
i) cout.defaultFill();
ii)cout.fill(0);
iii)cout.fill(' ');
e) If unexpected data is processed in an I/O operation:
i) An excecption will be thrown.
ii) An error message will automatically be displayed.
iii) Various errors are set.
f) One difference between the three-argument version of the get function and the getline funciton is that:
i) Only get has delimeter.
ii) The getline function removes the delimiter from the stream.
iii) Only get adds the delimiter to the array.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started