First you have to extract a word from your text file.
Second compare it with the word you want to search.
false?-->extract the next word from the file and compare again etc.
until the end of file is reached.
can anyone help me!? i have to create program to search word from text file, but i don't know how can i match word from input to text.. Can anybody help!!!??
Not much there to go on but it appears you have no indices therefore can use a simple character compare by stepping through the text. The problem is that this type of compare can be very time consumming.
Alternately, you might be able to use the built in library routines for text string handling and simply look for the target text within the text to be searched. Might be the simplest and fastest way to go.
You should find examples of either method in the complier's docs or any basic programming manual.
C++ has a string class which contains a compare method. You certainly have some documentation where you can get info about those. If you can find it you can even do better.
I can understand that is is all new to you, and that it is difficult to grasp it all, but why use char array when there is a string class? Why do you refuse to read or look up documentation?
You do #include <string> so why don't you use it?