Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   string parsing (http://www.velocityreviews.com/forums/t460011-string-parsing.html)

Gary Wessle 01-24-2007 06:47 AM

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

John Harrison 01-24-2007 07:29 AM

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.

Ondra Holub 01-24-2007 08:42 AM

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).


raxitsheth2000@yahoo.co.in 01-24-2007 10:10 AM

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



Rolf Magnus 01-24-2007 11:37 AM

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 12:33 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.