-1

i am new to visual c++ and i am learning oop ,i want ideas or how i can go about this small project i want to create i hope it will help me,i want to write a Class to search the file for a given pattern (eg, content) using visual c++ i want to put a button called search and i want to put an editbox1 where i can enter the path of the where the file is located eg "c:\folder\file1_.txt",then another editbox2 where i can enter words i want to search more like a the find button in word2007,i want it to work in such a way that when i enter the path where the file is located and click open the file should open and when i enter the word and click search it should show the string or word....i need ideas on how i can do this or how to do it your response will be highly appreciated, lets say i want something like this code below....

void SearchInFile(const std::string strToSearch, std::string& fileToSearch)
{
////....
}

int main()
{
SearchInFile("abc123", "myfile.txt");
}
kryticrecte
  • 377
  • 1
  • 7
  • 14
  • 1
    This is an awfully broad question. Are you looking with help on how to develop the GUI, the string searching, the file handling, all of the above? – Jerry Coffin Mar 02 '12 at 04:45
  • [This might point you in the right direction...](http://stackoverflow.com/questions/7531890/function-of-searching-a-string-from-a-file) – Michael Fredrickson Mar 02 '12 at 04:46

1 Answers1

2

Instead of writing something from scratch to do this, you might be interested in the built-in std::string method find. You can read about it here.

Alex Z
  • 2,500
  • 2
  • 19
  • 23