How do you open files with C++ through Windows?

Posted by: chav-tastic bob

How do you open files with C++ through Windows? - 05/06/05 03:24 PM

i.e. what command do you use?

Could anyone give me an example?
Say I wanted to open C:\mypic.jpg and C:\myapp.exe , both in Windows (using C++)

thanks
Posted by: zenon

Re: How do you open files with C++ through Windows? - 05/07/05 11:04 AM

Well.. that depends, you can open a file in binary or non-binary mode.
I supose you want to open the files in binary mode, yes? Annyway

----------------------------
#include
void main()
{
fstream filestr;
filestr.open ("test.txt", fstream::binary);
}
Posted by: chav-tastic bob

Re: How do you open files with C++ through Windows? - 05/14/05 11:29 AM

Thanks

(I *did* try looking through diff C++ guides first: most proved utterly useless)