How can i search nd compare strings using parsing
How can i search nd compare strings using parsing
Your question is a little vague... mind elaborating? This might help: http://www.tuxedo.org/~esr/faqs/smart-questions.html
Also, post any code that's relevant to the question (eg. Attempts at it)
Without more details of what you want, we can't answer adequately. Here is a potential solution, however:
-PreludeCode:#include <iostream> #include <string> #include <cstdlib> namespace { const std::string to_find = "arbitrary pattern"; } int main() { std::string search_buf; std::string::size_type found; // Fill search_buf with the data to search found = search_buf.find ( to_find ); if ( found != search_buf.npos ) std::cout<<"\""<< to_find <<"\" was found!"<<std::endl; else std::cout<<"\""<< to_find <<"\" was not found."<<std::endl; return EXIT_SUCCESS; }
My best code is written with the delete key.