Hi everyone,
I've been having a little trouble with an assignment I've been given and I'm looking for a little help. The assignment requires me to read in a line of text from the user, and then use Parallel Arrays (both iteratively & recursively), An Array of Object (iteratively, recursively, and pointer recursive), and an STL Vector (iteratively, and a for loop) to count the number of occurrences in the words that the user has entered.
I have a good grasp on parallel arrays, stl vectors, and the array of object, but my main problem is getting a method to input the text, parse it, and then print out how many times each word appeared. I honestly have been stumped forever and could use some direction. I've posted my (as of now completely useless) code below:
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
using namespace std;
int main(int argc, char **argv)
{
string input;
cout << "Hello! Please input your text: ";
getline(cin, input);
system("pause");
return 0;
}
If anybody has any suggestions, I'd be very thankful. I'm just trying to find any direction I can right now, I'm just totally lost on what seems like the most simple part of the assignment.
Finally, I searched for a half hour and couldn't find anything that applies to this particular problem, and apologize beforehand if I've ignorantly asked a question that's been answered many times before. If I have, if someone could be so kind as to point me in the right direction, I'd be greatly appreciative.
Thanks again.