ok, well, now I have more questions. I've searched online and can't find the answer. Spoke with some friends of mine who took c++ once (a long time ago, in a galaxy far, far away) and they can't remember.
When you open a file, you use a file handle, a la:
In this case, my file handle is 'filelist'. I can close the file:
but, if I try to open another file using the same handle later on, I get an error.
which implies you can't reuse file handles. This can't be right. There's probably some way to clear the handle entirely so you can reuse it. Anyone know how the hell to do that?
also, I have a question about parsing an input.....
let's say I have a variable along the lines for "blah, blah blah blah, etc etc, blah" and I want to parse it into an array broken up on the commas. In php, I'd just $thevariable = explode(",",$thevariable). What's the best way of doing this in c++? I hacked together a way of parsing it using .find and .substr, but it's not very pretty. However, it does work. Any pointers?
completed code:
(an example line from the file would be 'afilename.asp,c:\program files\etc').