What is it means File Processing consist struct ?
File Processing
Collapse
X
-
#include <stdio.h>
void main (void)
{
int account;
char name[30];
float balance;
FILE *fptr;
if ((fptr= fopen("D:/clients.txt", "w")) == NULL)
printf("Error: the file cannot be opened\n");
else {
printf("Enter the account #, name and balance or EOF to end input:\n");
scanf("%d %s %f", &account, &name, &balance);
while (!feof(stdin)) {
fprintf(fptr, "%d %s %.2f\n", account, name, balance);
scanf("%d%s%f", &account, &name, &balance);
}
}
fclose(fptr);
}
this is the example.
how can we include struct in it.Comment
Comment