File I/O : Which one to use? CFile or fstream?
-
Hello, I am working with VC++ 6.0 (MFC). I need to write the following structure to a file in binary mode. struct EmployeeData { char strName[50]; UINT nAge; float fSalary; }; For that, which class that I will use? CFile or fstream? TIA, Regards, Jahfer V P
-
Hello, I am working with VC++ 6.0 (MFC). I need to write the following structure to a file in binary mode. struct EmployeeData { char strName[50]; UINT nAge; float fSalary; }; For that, which class that I will use? CFile or fstream? TIA, Regards, Jahfer V P
I suggest you should use the CFile rather than fstream. You can do lots of things using the functionality CFile provides
-
I suggest you should use the CFile rather than fstream. You can do lots of things using the functionality CFile provides
-
You can get some basic implementations at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/\_core\_files\_in\_mfc.asp and http://www.codersource.net/mfc\_cfile.html