New to C++

I am trying to calculate pay for 10 individuals, and have that data entered into a file. I'm trying to use fptr, can anyone give me some examples of how to do this?
what is ftpr ?

you can use string delimiter to do this. Depending on what is in each string, of course if you provide some examples. If you have the choice of storing what is in each line, then using find_first_of or substring should be able to accomplish this.
It's the file pointer. I want to create a file that has employees information, and I want to have all of the information for the 20 employees saved to a file. Our instructor had given us an example in class. The example he gave is below. I'm trying to have my employee's pay calculated and sent to a file.

{

FILE *fptr;

char name[40];

int age; float weight;


fptr = fopen ("biodata.txt", "w");

do {

printf("Type name, age, and weight: ");

scanf("%s %d %f", name, &age, &weight);

fprintf(fptr, "%s\t%d\t%f\n", name, age, weight);

}

while (strlen(name) > 1);

fclose(fptr);

return 0;

}
Topic archived. No new replies allowed.