写txt 文件



      #include <iostream>
     #include <fstream>

 

      std::string save_file_name(stTargWRLName.GetBuffer());
    std::ofstream  file_open;
    file_open.open(save_file_name.c_str());
    int nVerSize;
    float fSaliency = 0.0f;
    if(file_open.is_open())
    {
        nVerSize = G_pScene->m_nVertices;
        file_open<<nVerSize;

        for (int i = 0; i < nVerSize; ++i)
        {
            fSaliency = m_final_saliency[i];
            file_open<<fSaliency;
        }

        file_open.close();
    }

你可能感兴趣的:(写txt 文件)