Hi all,

I am trying to write into file using CArchive class. I have written a simple code just to open a file using and write into it using CArchive class.

Code:
CFile file;CFileException e;file.Open(L"C:\\file.txt",CFile::modeReadWrite,&e);CArchive ar (&file, CArchive::store);char c = 'A';int i = -400;float f = 1.25f;double d = 3.14159265;ar << c;ar << i;ar << f << d;
but when i open the file the content inside it is

Apþÿÿ ?ñÔÈSû! @

Please anybody can tell me what exactly i am doing wrong

Thanks in advance