|
-
December 12th, 2009, 07:09 AM
#2
Re: Writing in a file using CArchive class
Next time when you post your code in code tags, please dont forget to put linebreaks wherever necessary.. it was hard to read, and i copied your code into a notepad, and put linebreaks to make it readable!
Anyway, try this...
Code:
CFile file;
CFileException e;
file.Open( _T( "C:\\file.txt" ), CFile::modeCreate | CFile::modeReadWrite, &e );
char buffer[50];
memset( buffer, 'A', sizeof(buffer) );
file.Write( buffer, sizeof(buffer) );
file.Flush( );
"I studied everything but never topped. Today, toppers of the world's best universities are my employees"
-William Henry Gates (Bill Gates)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|