Question: Suppose you wrote a program that reads data from cin . You are now required to reimplement it so that you can read data from
Suppose you wrote a program that reads data fromcin You are now required to reimplement it so that you can read data from a file. You are considering the following changes.
I. Declare anifstreamvariableinfile
II Replace all occurrences ofcinwithinfile
III. Replace all occurrences ofandgetlinewith the appropriate operations forifstreamobjects
What changes do you need to make?
Suppose you wrote a program that reads data fromcin You are now required to reimplement it so that you can read data from a file. You are considering the following changes.
I. Declare anifstreamvariableinfile
II Replace all occurrences ofcinwithinfile
III. Replace all occurrences ofandgetlinewith the appropriate operations forifstreamobjects
What changes do you need to make?
I and III
II and III
I, II and III
I and II
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
