Writes data from a buffer to the file associated with the CFile object.
virtual void Write(
const void* lpBuf,
A pointer to the user-supplied buffer that contains the data to be written to the file.
The number of bytes to be transferred from the buffer. For text-mode files, carriage return–linefeed pairs are counted as single characters.
Write throws an exception in response to several conditions, including the disk-full condition.
cfile.Open(_T("Write_File.dat"), CFile::modeCreate |
memset(pbufWrite, 'a', sizeof(pbufWrite));
In addition, see the examples for CFile::CFile and CFile::Open.