如何才能把存盤的內容另存到txt檔案中顯示出來
uj5u.com熱心網友回復:
你怎么用的vector? vector<string> ???遍歷vector取出資料,然后寫檔案即可~
for(vector<string>::const_iterator iter = vec.begin(); iter != vec.end(); ++iter)
{
// ...
}
uj5u.com熱心網友回復:
是的
uj5u.com熱心網友回復:
是的
你怎么用的vector? vector<string> ???
遍歷vector取出資料,然后寫檔案即可~
for(vector<string>::const_iterator iter = vec.begin(); iter != vec.end(); ++iter)
{
// ...
}
你的observe_o這個類支出序列化不?
Five main steps are required to make a class serializable. They are listed below and explained in the following sections:
Deriving your class from CObject (or from some class derived from CObject).
Overriding the Serialize member function.
Using the DECLARE_SERIAL macro in the class declaration.
Defining a constructor that takes no arguments.
Using the IMPLEMENT_SERIAL macro in the implementation file for your class.
If you call Serialize directly rather than through the >> and << operators of CArchive, the last three steps are not required for serialization.
異或是簡單一點,你for回圈中取出每個observe_o元素,將observe_o類物件的相關資訊格式化為字串,然后存入檔案中即可。
uj5u.com熱心網友回復:
是的
你怎么用的vector? vector<string> ???
遍歷vector取出資料,然后寫檔案即可~
for(vector<string>::const_iterator iter = vec.begin(); iter != vec.end(); ++iter)
{
// ...
}
是的
你怎么用的vector? vector<string> ???
遍歷vector取出資料,然后寫檔案即可~
for(vector<string>::const_iterator iter = vec.begin(); iter != vec.end(); ++iter)
{
// ...
}
你的observe_o這個類支出序列化不?
Five main steps are required to make a class serializable. They are listed below and explained in the following sections:
Deriving your class from CObject (or from some class derived from CObject).
Overriding the Serialize member function.
Using the DECLARE_SERIAL macro in the class declaration.
Defining a constructor that takes no arguments.
Using the IMPLEMENT_SERIAL macro in the implementation file for your class.
If you call Serialize directly rather than through the >> and << operators of CArchive, the last three steps are not required for serialization.
異或是簡單一點,你for回圈中取出每個observe_o元素,將observe_o類物件的相關資訊格式化為字串,然后存入檔案中即可。
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/130504.html
標籤:基礎類
上一篇:mfc操作msppt.h
下一篇:win2012server 上用ado連接 oracle12c 出現800a0e7a source adodb.connection 未找到提供程式
