Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 204
  • Last Modified:

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

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
marcCbrands
Asked:
marcCbrands
1 Solution
 
ExceterCommented:
>> 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
 
DanRollinsCommented:
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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now