Question: C++ I am trying to sort a .txt file by individual words and store the words in a char array, so I can later sort

C++

I am trying to sort a .txt file by individual words and store the words in a char array, so I can later sort the words in ASCII order.

the text file looks like this:

"input.txt"

This This This

is a line

is a line

done

This

line

My goal is to get the individual word, and compare it to my "keyword index" so that will just state the word once, and how many times it occurs.

so the output would look like

"This" 4 times

"line" 3 times

etc...

The trick is I am trying to do it with c-string (so just char arrays) and not , which I know would be much easier.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!