How can I save a web page using C++?

My teacher has asked me to write a program that:

*Reads an url from the keyboard (VERY easy)
*Saves the page's source code (.html) in the computer (WTF?)

How should I do this? I have no idea of how to access a web page using C/C++. I tried using fopen(url,"r"), but , as I expected, it didn't work.
Last edited on
Try using libcurl (I've heard it's a bit much, but I haven't seen any other good ways)

http://curl.haxx.se/libcurl/
Yeah, I've seen this libcurl before. But I don't think it makes any sense if there's no other way to do it. I mean, why would my teacher ask it if the only thing I can do is use a huge library developed by other people than me?

Besides, I'd use just few functions/methods/whatever.

=/

Thanks anyway. Any other options?
Last edited on
On Windows, there are plenty of simple methods from URLDownloadToFile() to COM...
Topic archived. No new replies allowed.