Solved

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

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

705 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

16 Experts available now in Live!

Get 1:1 Help Now