string parsing

Discussion in 'C++' started by Gary Wessle, Jan 24, 2007.

  1. Gary Wessle

    Gary Wessle Guest

    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
    Gary Wessle, Jan 24, 2007
    #1
    1. Advertising

  2. 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.
    John Harrison, Jan 24, 2007
    #2
    1. Advertising

  3. Gary Wessle

    Ondra Holub Guest

    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).
    Ondra Holub, Jan 24, 2007
    #3
  4. Gary Wessle

    Guest

    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 <> 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
    , Jan 24, 2007
    #4
  5. Gary Wessle

    Rolf Magnus Guest

    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.
    Rolf Magnus, Jan 24, 2007
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. GIMME
    Replies:
    2
    Views:
    869
    GIMME
    Feb 11, 2004
  2. Naren
    Replies:
    0
    Views:
    572
    Naren
    May 11, 2004
  3. Christopher Diggins
    Replies:
    0
    Views:
    600
    Christopher Diggins
    Jul 9, 2007
  4. Christopher Diggins
    Replies:
    0
    Views:
    424
    Christopher Diggins
    Jul 9, 2007
  5. John Levine
    Replies:
    0
    Views:
    718
    John Levine
    Feb 2, 2012
Loading...

Share This Page