|
Blue Forest http://www.lslnet.com at 10:18 on June 6, 2006
Document operation of the C + + If the documents do not exist, the new document, as follows :
The problem is there is no documentation, they can create documents, but the document is empty, can write? Why?
Brother asked, I want to write a number of documents 0, how convenient Thank you!
#include "Iostream>;
#include "Fstream>;
Using namespace std;
Int main ()
{
Fstream fs;
Fs.open ( "ttt," in|ios ios : : : : : : binary|ios out);
4003rd fs.close ();
If (!fs.is_open ())
{
Fs.open ( "ttt," out|ios ios : : : : binary);
Int i Z
Int j Z
While (i++<10)
4003rd fs.put (j);
Fs.write ((const char*) &j, sizeof (int));
Return 1;
}
Return 0
} |
Document operation of the C + + 1. Open mode option is to establish the parameters for the document can be written specifically to check msn.
2. 0 can be put directly to write a format string or reuse write. |
Document operation of the C + + Note : If you write the 0 to add more exact, which can be used UNION, into faster. |
Document operation of the C + + -->
This is not the two reasons?
[code]
#include "Iostream>;
#include "Fstream>;
Using namespace std;
Int main ()
{
Fstream fs;
Fs.open ( "ttt," in|ios ios : : : : : : out|ios binary);
Int i Z
Int j Z
While (i++<10)
{
Fs.put (0);
Fs.write ((const char*) &j, sizeof (int));
}
Fs.close ();
Return 0
}
[/code]
This can write [/quote]-->--> |
| |