File Processing - Sequential and Direct Access/lab7a.c
void saveEmpList(const Employee *EmpList, const char *FileName){
    FILE *filePtr;

    if((filePtr = fopen(FileName, "w")) == NULL) puts("FILE COULD NOT BE OPENED");
    else{
        for(size_t i = 0; i < EMP_ARR_SIZE; i++){     
            fprintf(filePtr, "%d %s %s %.1f\n", EmpList[i].id, EmpList[i].firstname, EmpList[i].lastname, EmpList[i].GPA);
        }
        fclose(filePtr);
    }    
}
/*  
    saveEmpList: Save the employee records from the list to the newly created text file specified by FileName
    input: the array to read from, the file to write to 
*/
Save the employee records from the list to the newly created text file specified by FileName
input: the array to read from, the file to write to
Save the employee records from the list to the newly created text file specified by FileName input : the array to read from the file to write to
void saveEmpList(const Employee *EmpList, const char *FileName){
    FILE *filePtr;
    if((filePtr = fopen(FileName, "w")) == NULL) puts("FILE COULD NOT BE OPENED");
    else{
        for(size_t i = 0; i < EMP_ARR_SIZE; i++){     
            fprintf(filePtr, "%d %s %s %.1f\n", EmpList[i].id, EmpList[i].firstname, EmpList[i].lastname, EmpList[i].GPA);
        }
        fclose(filePtr);
    }    
}
void saveEmpList ( const Employee * EmpList , const char * FileName ) { FILE * filePtr ; if ( ( filePtr = fopen ( FileName , " " ) ) == NULL ) puts ( " " ) ; else { for ( size_t i = 0 ; i < EMP_ARR_SIZE ; i ++ ) { fprintf ( filePtr , " \n " , EmpList [ i ] . id , EmpList [ i ] . firstname , EmpList [ i ] . lastname , EmpList [ i ] . GPA ) ; } fclose ( filePtr ) ; } }
saveEmpList: Save the employee records from the list to the newly created text file specified by FileName
input: the array to read from, the file to write to
saveEmpList : Save the employee records from the list to the newly created text file specified by FileName input : the array to read from the file to write to