Question: Consider the code bellow. The file letters . dat contains ABCDEFGHIJ int main ( ) { fstream fin ( letters . dat, ios::in |

Consider the code bellow. The file letters.dat contains ABCDEFGHIJ
int main()
{
fstream fin("letters.dat", ios::in|ios::binary);
char a;
fin.get(a);
cout << a;
fin.seekg(3, ios::beg);
fin.get(a);
cout << a ;
fin.seekg(-4, ios::end);
fin.get(a);
cout << a;
seekg(2, ios::cur);
fin.get(a);
cout << a << endl;
return 0;
}
What will be the output?
Group of answer choices
DEFG
ACEJ
Aaaa
ABCD
ADGJ

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!