![]() |
string parsing
Hi
how can I do this in C++ string myword; string get_word_from_this_url( url ){ bool flag = true; while flag; download this url and search for this word; if found; set flag to false; retrun word; } I know c++ does not have load(url), do I need to go to perl or some other language? thanks |
Re: string parsing
Gary Wessle wrote:
> Hi > > how can I do this in C++ > > string myword; > string get_word_from_this_url( url ){ > bool flag = true; > while flag; > download this url and search for this word; > if found; set flag to false; > retrun word; > } > > I know c++ does not have load(url), do I need to go to perl or > some other language? > > thanks Standard C++ does not have any means of loading a URL. That does not mean that your C++ implementation does not have one, it probably does. But this group deals with standard C++ only, so you should ask this question in a group for your compiler and/or operating system. Since loading a URL is likely to be a feature of your operating system perhaps you should try a group about programming C++ on your particular operating system. BTW perl would a good choice for string parsing, it's not one of C++'s better features. |
Re: string parsing
Gary Wessle napsal: > Hi > > how can I do this in C++ > > string myword; > string get_word_from_this_url( url ){ > bool flag = true; > while flag; > download this url and search for this word; > if found; set flag to false; > retrun word; > } > > I know c++ does not have load(url), do I need to go to perl or > some other language? > > thanks Not part of standard C++. You can use some library or OS specific API. I recommend to use some library which is supported on many platforms. For example libCURL (simpler) or ACE (harder to learn but great library, but for small example you gave it is too strong tool). |
Re: string parsing
try to do with libwww or curl , they are reusable library that what u want to do i think, --raxit On Jan 24, 11:47 am, Gary Wessle <phd...@yahoo.com> wrote: > Hi > > how can I do this in C++ > > string myword; > string get_word_from_this_url( url ){ > bool flag = true; > while flag; > download this url and search for this word; > if found; set flag to false; > retrun word; > > }I know c++ does not have load(url), do I need to go to perl or > some other language? > > thanks |
Re: string parsing
John Harrison wrote:
> Gary Wessle wrote: >> Hi >> >> how can I do this in C++ >> >> string myword; >> string get_word_from_this_url( url ){ >> bool flag = true; >> while flag; >> download this url and search for this word; >> if found; set flag to false; >> retrun word; >> } >> >> I know c++ does not have load(url), do I need to go to perl or >> some other language? >> >> thanks > > Standard C++ does not have any means of loading a URL. Basically, there is nothing in the standard preventing an fstream implementation from taking URLs for remote file support. However, such implementations are rare. |
| All times are GMT. The time now is 08:18 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.