Trouble with Extraction

I'm working on a project and I have to extract each word of a line that the operator just entered in the program. I'm not sure how to do that. Any help with be super appreciated.

Here is my code...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include<iostream>
#include<string>
using namespace std;!!
class StringModify!
{!
public:!
void get_data();!
//takes a line of input from the user
void extract_word();!
//extracts each word from the input line
string reverse_word(const string& s);!
//returns a string which is reverse of s
void swap(char& v1, char& v2);!
//interchanges value of v1 and v2
void append(const string& reverse_word);!
//puts together each reversed word with whitespaces to get formatted_line
void display();!!
//displays both input line and formatted_line
private:!
string line;! //original string
string formatted_line;!//formatted string
};
int main()
{
StringModify data1;

string get_data;

cout<<"Enter the string: ";
get_data(string);
cout<<"The original string is: "<<get_data<<endl;

return 0;
}
void StringModify::get_data()!
}

}
void StringModify::extract_word()!
{
// Insert your code here
}
string StringModify::reverse_word(const string& s)
{
// Insert your code here
}
void StringModify::swap(char& v1, char& v2)
{
// Insert your code here
}
)
Topic archived. No new replies allowed.