Hi folks,
This is my code. I don't know what error in this. Please help me to correct it
Code:
struct m_Record
{
int number;
char S_trancode[3];
char S_sectype[5];
char S_secsym[8];
char D_tdate[9];
char D_sdate[9];
int N_quantity;
int N_trdamt;
char S_sourcetype[5];
char S_sourcesym[8];
}mRecord;
struct inx_Record
{
int number;
char D_tdate[9]
}inxRecord;
// read a record from the main
int ReadRecord(FILE *File, int RecNum, struct m_Record Record)
{ if( fseek(File, RecNum * sizeof(Record), SEEK_SET) == 0 )
if ( fread(&Record,sizeof(Record),1,File) )
return 1;
return 0; }
// read a record from the index file
int ReadRecord(FILE *File, int RecNum, struct inx_Record Record)
{ if( fseek(File, RecNum * sizeof(Record), SEEK_SET) == 0 )
if ( fread(&Record,sizeof(Record),1,File) )
return 1;
return 0; }
void ListRecords(FILE *File,struct m_Record Record )
{
int i = 0;
tcnt=0;
while (ReadRecord(File,i,Record))
{
if (Record.number != -1)
{
printvalues();
tcnt++;
}
i++;
}
printf("\n\n");
printf("Total Records : %ld",tcnt);
printf("\n\n");
}
void ListRecords(FILE *File,struct inx_Record Record )
{
int i = 0;
tcnt=0;
while (ReadRecord(File,i,Record))
{
if (Record.number != -1)
{
printvalues();
tcnt++;
}
i++;
}
printf("\n\n");
printf("Total Records : %ld",tcnt);
printf("\n\n");
}
/////////// in my main function i will call the ListRecords() function as below
FILE *File;
c=toupper(getchar());
switch(c)
{
case '1' :
File = FileOpen(FNAME);
break;
case '2' :
File = FileOpen(TEMPF);
break;
}
if (!File)
{
printf("Curses foiled again!\n\n");
exit(-1);
}
if (c=='1')
ListRecords(File,mRecord);
else
ListRecords(File,inxRecord);
i got the below error
Code:
difffiles.c:69:5: error: conflicting types for ‘ReadRecord’
difffiles.c:62:5: note: previous definition of ‘ReadRecord’ was here
difffiles.c:187:6: error: conflicting types for ‘ListRecords’
difffiles.c:168:6: note: previous definition of ‘ListRecords’ was here