Possible Duplicate:
How to convert std::string to LPCSTR?
I'm interested in making a function which will go through a range of pages on a website and download the information from each one. For example - mywebsite.com/?page=1, mywebsite.com/?page=2, ?page=3, etc. I thought it would be easy to do this automatically, but apparently not. To download the HTML source I've been using a function called URLOpenBlockingStream(). This function takes the URL of the site as a parameter, as data dype LPCSTR (I assume "Long Pointer to Constant String"). This seems to stop it from going to any website except an exact one which I hard-code in.
All reasonable attempts to circumvent this problem have resulted in either a compile or runtime error. Is there a way around it, or perhaps another function I should be using?
Thanks in advance!
I have just worked this issue out after a lot of trouble and googling. Sorry, it won't let me answer my own question because I'm new, but for anyone looking, here's how it works:
First, get all your URL into one string. Look up stringstreams if you need to know how to convert an int or whatever. Then, use string::c_str(), which returns a constant string, which can then be converted into an LPCSTR.