Solved

looking for a function that will load a URL into a character array

Posted on 2003-11-04
2
194 Views
Last Modified: 2010-04-02
I am looking for a C++ function that I can give an URL and that will load the html and make it stream avalaible to me. Something like this:

char* s;
s = load("http://www.cnn.com");

Marc
0
Comment
Question by:marcCbrands
2 Comments
 
LVL 8

Expert Comment

by:Exceter
ID: 9683890
>> char* s;

This is a pointer and cannot store anything.

>> s = load("http://www.cnn.com");

You can do it like this however,

char s[100];
strcpy( s, "http://www.cnn.com" );
cout << s << endl;

-- output --
http://www.cnn.com

Cheers!
Exceter

0
 
LVL 49

Accepted Solution

by:
DanRollins earned 125 total points
ID: 9684930
Do you want to download a webpage?
If so, the easiest way is probably to use
     XmlHttpRequest
or
     UrlDownloadToFile

A similar question has been asked here:
      http://www.experts-exchange.com/Programming/Programming_Languages/Cplusplus/Q_20663821.html
and plenty of code is provided.

-- Dan
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question