Hi, there im a new member, I have a few questions. i am having a problem i am trying tp find words that are related together by one word for example "dous" Tremendous,stupendous ect... I have my code working so that it goes through my text file and picks out all of the dous in the file, but how do i get the CMD to not only show "dous" when it is found, but the whole word" im a bit confused :-/.

here is my code:

using namespace std;

int main ()
	char* search = "dous";
	int offset;
	string TEXT;
	ifstream in_stream;
		cout<<"File will not open, file possible dont exist or is corrupted"<<endl;
if( in_stream.is_open())
		if ((offset = TEXT.find(search, 0)) != string::npos) 
		cout << "found " << search << endl;

Recommended Answers

All 2 Replies

line 25 is using the wrong variable. display TEXT, not search.

Thx Man!, I knew it was something easy that i just needed to switch

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.