I m trying to convert C code to C++. Facing some difficulties help me out!
//This is struct
typedef struct index
{
int id;
char word[20];
int count;
}indexs;
// Function prototype
void fileScanner(FILE * ifp,int i);
void fileRead(FILE *ofp);
int findString(char s[],char u[]);
int searchEntry(indexs [],char key[],int n);
void StoreIndexInFile(FILE *); // <---is this correct?
void fileDisplay(FILE *ifp,FILE *ofp);
// Function to be called
void StoreIndexInFile(FILE *ifp,indexs ind[],int n)
{
indexs *i;
fprintf(ifp,"\nid word(root) frequency\n\n");
for(i=ind;i<ind+n;i++)
{
fprintf(ifp,"%d %-20s %d \n",i->id,i->word,i->count);
}
}
How can I call this function(with parameters)?