
Each of the following
as you can.
A) fstream file(ios :: in I ios :: out);
file.open("info.dat");
if (!file)
{
cout << "Could not open file.\n";
}
B) ofstream file;
file.open("info.dat", ios::in);
if (file)
{
cout << "Could not open file.\n";
}
C) fstream file("info.dat");
If (!file)
{
cout << "Could not open file.\n";
}
D) fstream dataFile("info.dat", ios:in I ios:binary);
int X = 5;
dataFile << x;
E) fstream dataFile("info.dat", ios:in);
int x;
while (dataFile.eof())
{
)
dataFile >> x;
cout << x << endl;
F) fstream dataFile("info.dat", ios:in);
char line [81];
dataFile .get(line);
G) fstream dataFile("info.dat", ios:in);
char stuff[81];
dataFile.get(stuff);
H) fstream dataFile("info.dat", ios:in);
char stuff [81] = "abcdefghijklmnopqrstuvwxyz";
dataFile.put(stuff);
I) fstream dataFile("info.dat", ios:out);
struct Date
{
int month;
int day;
int year;
);
Date dt = { 4, 2, 98 };
dataFile.write(&dt, sizeof(int));
J) fstream inFile("info.dat", ios:in);
int x;
inFile.seekp(5);
inFile >> x;

Want to see the full answer?
Check out a sample textbook solution
Chapter 13 Solutions
Starting Out with C++: Early Objects
Additional Engineering Textbook Solutions
Starting Out with C++ from Control Structures to Objects (9th Edition)
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
Modern Database Management
Starting Out with Python (4th Edition)
BASIC BIOMECHANICS
Web Development and Design Foundations with HTML5 (8th Edition)
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning




