String与string的转化 String转化为std::string 例子: CString strMfc="test"; std::string strStl; strStl=strMfc.GetBuffer(0); std::string转化为CString 例子: CString strMfc; std::string strStl="test"; strMfc=strStl.c_str(); 文件为空的判断方法 ofstream App("fp.txt", ios::app); App.seekp(0,ios::end); ofstream::pos_type end_mark=App.tellp(); App.seekp(0,ios::beg); ofstream::pos_type beg_mark= App.tellp(); if(beg_mark==end_mark)//表示空文件