I have a problem because this is my first time encountering some functions from C that I need to convert into C++.
Code:
FILE *pokf;
char name[10],gender;
int age, i, n, b1=0, b2=0;
float p;
pokf=fopen("Data.txt","r");
while (feof(pokf)==0) {
fscanf (pokf,"%s %c %d %f", &name, &gender, &age, &p);
if (gender=='Z') b1++;
if (p>=4.50 ) b2++; }
fclose(pokf);
I can write:
ifstream input;
input.open("Data.txt");
But then I don't know what to use instead of pokf because I can't use FILE *pokf anymore. What to use instead of functions feof and fscanf?