Hey guys, im new to C programming and after a few classes, I'm still stuck on trying to figure out this program concerning sequential files. The thing is, I have a majority of the program written, but I believe there are major flaws in the code (at least the compilier im using tells me this). I dont want anybody to do it for me, but I dont understand how pointers work in structs, methods, etc. I hope i didn't confuse you already with what I'm trying to say, but please advise.

Code:
 
#define MAXKEY 999
#define NAMELEN 7
#define SENTINEL -1
#define MAXTESTPTS 120
#define MAXHWCOUNT 10
#define MAXHWPOINTS 50

#define TRUE 1
#define FALSE 0		 

struct StudentRecord {	
 int    	id;      
 char   name [NAMELEN]; 
  int    	test1;                // score of first test
  int    	test2;               // score of second test
  int    	test3;                 // score of third test
  int 	hwCount;          // number of hws completed
  int 	hwPoints;         // points accumulated on hw
} dummyRecord = {SENTINEL, "", 0, 0, 0, 0, 0}; 
                     // dummy file used to present format? not sure

struct TransactionRecord {
  int	kind;			
                // holds values 0 to 5 */
	// 0 = Insert, 1-3 = Modify Test Score k	
	// 4 = Add HW assignment & points, 
                //  5 = Add HW points w/o assignment)

  int	id;  
  char	name [NAMELEN];  
  int 	value;           
} dummyTrans = {SENTINEL, SENTINEL, "", 0};
                 // dummy file

// temporary data types used for intermediate reading and writing
int tkind;
int tid;
char tname [NAMELEN];
int tvalue;



file  *inputFile;
file  *recordFile;
file  *transFile;
file *newRecordFile;
file  *errorFile;
//  declarations used for holding files 

int numOldRecords, numNewRecords;
	
int	numTrans, numErrors;
		
char *  internalError  = "Internal error. Sorry. \n";

char *	redundantInsert = "Attempt to insert duplicate record with key %d";

char *	invalidInsert = "Can't insert record with key %d; record already exists\n";

char *	invalidModify = "Invalid modify operation with key %d; no record to modify\n";

char *	invalidDelete = "Invalid delete operation with key %d; no record to delete\n";

char *	numberError = "Invalid update with key %d; numerical constraint violated\n";

int openFiles ( ){

    if ((inputFile = fopen ("inputfile.txt", "r")) == NULL) 
  {

    fprintf (stderr, "Cannot open input file\n");
    return -1; 
  }

  if ((recordFile = fopen ("recordfile.txt", "w")) == NULL) 
  {
    fprintf (stderr, "Cannot open report file\n");
    return -1; 
  }
  if ((transFile = fopen ("transfile.txt", "r")) == NULL) {
    fprintf (stderr, "Cannot open file to hold data\n");
    return -1; }
  if ((newRecordFile = fopen ("newrecordfile.txt, w+" == NULL){
    fprintf (stderr, "Cannot open new record file\n");
    return -1;}
  if ((errorFile = fopen ("errorfile.txt, r+" == NULL){
    fprintf (stderr, "Cannot open error file\n");
    return -1;}
  else 	/* all files opened successfully */
    return 0;
};

void closeFiles ( ){
  fclose (inputFile);
  fclose (recordFile);
  fclose (newRecordFile);
  fclose (reportFile);
  fclose (transFile);
  fclose (errorFile);
}
 
        
	
int getTransFromTransFile (transFile, tkind, tid, tname[NAMELEN]){                
  if(fseek(transFile, %d) != NULL){
       return -1;
}else{                          
     tkind = fscanf(transFile,%d) // reads the type of the transaction and stores it
     fseek (transFile, %d);         // finds the next int, which is the id
     tid = fscanf(transFile,%d);  // stores that into the trans id 
     fseek (transFile, %s);
     tname[NAMELEN] = fscanf(transFile,%s);
     if(tkind != 0){     

// here im assuming that an insert trans does not add hw or test scores
              
      fseek(transFile, %d);
      int tvalue = fscanf(transFile,%d);
              }
     fseek (transFile,"\n");  
     return 0;     
}
     
void logError (char * errMsg, int id)
{
  fprintf (ReportFile, "%s %d\n", errMsg, id);
}

void createRecords(inputFile,recordFile, ){
     while(fseek(inputFile, %d) != NULL){
        // create  new student record if pass is not null
            StudRec = new StudentRecord();
            fseek(inputFile, "%d");
            StudRec.id = fwrite(recordFile, fscanf(inputFile,%d,&id), &id);
            // looks for next character in the file
            fseek(inputFile, "%s");
            StudRec.name = fwrite(recordFile, fscanf(inputFile,%s,&name), &name);
            fseek(inputFile, "%d");
            StudRec.test1 = fwrite(recordFile, fscanf(inputFile,%d,&test1), &test1);
            fseek(inputFile, "%d");
            StudRec.test2 = fwrite(recordFile, fscanf(inputFile,%d,&test2), &test2);
            fseek(inputFile, "%d");
            Studrec.test3 = fwrite(recordFile, fscanf(inputFile,%d,&test3), &test3);
            fseek(inputFile, "%d");
            Studrec.hwcount = fwrite(recordFile, fscanf(inputFile,%d,&hwcount), &hwcount);
            fseek(inputFile, "%d");
            Studrec.hwpoints = fwrite(recordFile, fscanf(inputFile,%d,&hwpoints), &hwpoints);
            fwrite(recordFile,"\n"); // after complete write of record, write new line
            numOldRecords ++;
            }
}
 
int copyRecords (recordFile, newRecordFile); // runs only when all transactions are complete
	while(fseek(recordFile, %d) != NULL){
            StudRec = new StudentRecord();
            fseek(inputFile, "%d");
            fwrite(newRecordFile, fscanf(recordFile,%d,&id), StudRec.id);
            // looks for next character in the file
            fseek(inputFile, "%s");
            fwrite(newRecordFile, fscanf(recordFile,%s,&name), StudRec.name);
            fseek(inputFile, "%d");
            fwrite(newRecordFile, fscanf(recordFile,%d,&test1), StudRec.test1);
            fseek(inputFile, "%d");
            fwrite(newRecordFile, fscanf(recordFile,%d,&test2), StudRec.test2);
            fseek(inputFile, "%d");
            fwrite(newRecordFile, fscanf(recordFile,%d,&test3), StudRec.test3);
            fseek(inputFile, "%d");
            fwrite(newRecordFile, fscanf(recordFile,%d,&hwcount), StudRec.hwcount);
            fseek(inputFile, "%d");
            fwrite(newRecordFile, fscanf(recordFile,%d,&hwpoints), StudRec.hwpoints);
            return 0;
            }
 return -1;
}

void updateSequentialFile (transFile, tkind, tid, tname[NAMELEN], recordFile, newRecordFile){
	while(getTransFromTransFile (transFile, tkind, tid, tname[NAMELEN]) != -1){
          fseek(recordFile,%d);
          int rid = fscanf(recordFile,%d);
          if (tid > rid)
          if(tid < rid && tkind == 0){ // its an insert
                StudRec.id = new StdentRecord()
                fwrite(newRecordFile, tid, StudRec.id);
                fwrite(newRecordFile, " ");
                fwrite(newRecordFile, tname[NAMELEN], StudRec.name);
                fwrite(newRecordFile, " ");
                
                }
          // this part is ridiculous
          else if(tid == rid && tkind == 1){  //  modify test score 1
                fwrite(newRecordFile, tid);   // already set 
                fwrite(newRecordFile, " ");
                fwrite(newRecordFile, fscanf(recordFile, StudRec.name);
                fwrite(newRecordFile, " ");
                fwrite(newRecordFile, tvalue);
                fwrite(newRecordFile, " ");
                fwrite(newRecordFile, fscanf(recordFile, StudRec.test2);
                fwrite(newRecordFile, " ");
                fwrite(newRecordFile, fscanf(recordFile, StudRec.test3);
                fwrite(newRecordFile, " ");
                fwrite(newRecordFile, fscanf(recordFile, StudRec.hwcount);
                fwrite(newRecordFile, " ");
                fwrite(newRecordFile, fscanf(recordfile, StudRec.hwpoints);
                }
          else if(tid == rid && tkind == 2){
               fwrite(newRecordFile, tid);   // already set 
                fwrite(newRecordFile, " ");
                fwrite(newRecordFile, fscanf(recordFile, StudRec.name);
                fwrite(newRecordFile, " ");
                fwrite(newRecordFile, tvalue);
                fwrite(newRecordFile, " ");
                fwrite(newRecordFile, fscanf(recordFile, StudRec.test2);
                fwrite(newRecordFile, " ");
                fwrite(newRecordFile, fscanf(recordFile, StudRec.test3);
                fwrite(newRecordFile, " ");
                fwrite(newRecordFile, fscanf(recordFile, StudRec.hwcount);
                fwrite(newRecordFile, " ");
                fwrite(newRecordFile, fscanf(recordfile, StudRec.hwpoints);
                }
    numNewRecords ++;
    fwrite(newRecordFile,"\n"); // preparing for next pass
    fseek(recordFile, "\n");
}
    while(copyRecords(recordFile, newRecordFile) != -1){
    numNewRecords ++;
    }
}               
  


void reportStatistics ( ){
     fprintf(stderr, ("Number of Old records: ", numOldRecords, "\n"));
     fprintf(stderr, ("Number of New records: ", numNewRecords, "\n"));

     
void echoDataToScreen (){
     fprintf(stderr, "Process Completed. \n");
}

int main ( );
	/* opens files, checks for error */
    if (openfiles () != 0){
      createRecords();
      updateSequentialFile();
      copyFiles();
      getStatistics();
      echoDataToScreen();
}
    closeFiles();
       
    return;

I got rid of most of the comments n such from this to simplify it. The assignment was to write a sequential file program that takes an original sequential file and a transaction file, and then writes a new modified sequential file (after modifications according to the transactions). This is really confusing, and any help here would be huge. Thanks in advance!