>but how do i want to compare each token in string with word in text file in c++?
How do you define a token? If it's nothing more than a whitespace delimited sequence of characters, the >> operator may be better suited to your problem because it tokenizes input in such a way by default. Why have a two step process (read a line, then tokenize it) when you have a one step process (read a sequence of words)?
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Offline 11,807 posts
since Sep 2004