Question : i have problem in c++ ofstream ?

hello,

my problem appear after i changed the character set to Unicode from project properties

the function i attached here
1:
2:
3:
4:
5:
6:
7:
8:
9:
void addToFile(CString data,char* file)
{
	if(data == " "){}else{		
   ofstream log(file,ios::app);		
      log << data;
      log <<'\0';
      log.close();
	}
}

after excute it i found in the file only the address of data not the data


can any body fix that


thank you
 

Answer : i have problem in c++ ofstream ?

Use wofstream. CString data is the wide string now.
In MFC there is CFile class. If you use CString, you can use CFile too.

CodeProject. Upgrading an STL-based application to use Unicode.
http://www.codeproject.com/KB/stl/upgradingstlappstounicode.aspx
Random Solutions  
 
programming4us programming4us