Question: Modify this C++ program; It should show in descending ID order. The sample output is down below: #include #include #include using namespace std; struct sTy
Modify this C++ program; It should show in descending ID order. The sample output is down below:
#include
#include
#include
using namespace std;
struct sTy
{
char fName[15];
char LName[15];
int Id;
double Gr;
};
void pStDat(const sTy& stu);
int main()
{
int n=0;
sTy stt;
sTy *A;
ifstream iF;
ofstream oF;
long stsize = sizeof(stt);
iF.open ("studentRec.txt");
if(!iF)
{
cout
return 1;
}
iF.open("student.dat", ios::binary);
if (!iF)
{
cout
return 1;
}
iF.read(reinterpret_cast
A=new sTy[n];
int i=0;
while (iF)
{
if (stt.Id != 0)
{
A[i]=stt;
i++;
pStDat(stt);
}
iF.read(reinterpret_cast
};
cout
cout
cout
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts

