Solved

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

Posted on 2003-11-04
2
193 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

895 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now