string parsing

G

Gary Wessle

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
 
J

John Harrison

Gary said:
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.
 
O

Ondra Holub

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

raxitsheth2000

try to do with libwww or curl , they are reusable library that what u
want to do i think,

--raxit
 
R

Rolf Magnus

John said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top