Reposting this question All info that I got are included in
Solution
void uniqueword (ifstream&, ofstream&, char);
void uniqueword (ifstream &inputFile, ofstream &outputFile, char words[100][16])
{
int count[55]; // Holds the associated counts.
char *tok=0; //storing tokens
int uniqueCount = 0; // Counts the total number of unique words
// Read every unique word in the file.
while(!inputFile.eof())
{
inputFile >> words[99];
// If there is a match, increment the associated count.
if(strcmp(words[99], tok) == 0)
{
counter[99]++;
}
}
// Display each unique word and its associated count.
for(int i = 0; i < 100; i++)
{
cout << words[i] << \":\" << counter[i] << endl;
}
}
int main(int argc, char *argv[])
{
ifstream inputFile;
ofstream outputFile;
char words[100][16];
char inFile[12] = \"input.txt\";
char outFile[16] = \"unique word.txt\";
// Get the name of the file from the user.
cout << \"Enter the name of the file: \";
cin >> inFile;
// Open the input file.
inputFile.open(inFile);
// Open the output file.
outputFile.open(outFile);
if(inputFile)
{
while(!inputFile.eof())
{
uniqueword (inputFile, outputFile, words);//call the function
}
// Close the input file.
inputFile.close();
// Close the output file.
outputFile.close();
return 0;
}
else
{
// Display the error message.
cout << \"Input File not found.\ \";
}
}


