i want to know how do u open . write files in c++
i know in c
need to know the code line of c++
for ex: in 'c' u say
fopen(FILE,"w") //wite mode
how would i say this in c++
i want to know how do u open . write files in c++
i know in c
need to know the code line of c++
for ex: in 'c' u say
fopen(FILE,"w") //wite mode
how would i say this in c++
infile would be the file you read from, outfile the file you write to.Code:#include <fstream> ifstream infile("Filename goes here"); ofstream outfile("Filename goes here");
ok,
so wat r ios::xx used for and how?
They are different modifying options. For example, ios::nocreate will not create a file if it does not exist. If not there, a file will be created if it doesn't exist.
could u give me a simple code that would create a file binary file in C++
when i read a file its just brings up the hax value like 0xFFFFFF
what do i do to make it display the file contentsin stead
basically i do this
#define FILE "myfile.ext"
FILE *mf;
main()
ifstream inmf("myfile.ext", ios::binary);
// so this is gona open/create a file in binary mode, right?
ok after that line i want to write something to file how would i do that
like in c you do
fwrite(.....);
but how in C++
this time ans people!!!!
dont make me mad%*#U*4
dude theres a whole tutorial on file io on this website
+++
++
+ Sekti
++
+++
You can't write to files using ifstream, you have to use ofstream.
Then you can call ofstream::write(buffer, length);
More information can be found at http://msdn.microsoft.com/library/de..._Functions.asp