c++ 读取txt文件

void Load_GPS(const std::string gps_path, std::map<std::string, cv::Point3d> &all_gps_data)
{
    std::ifstream ifs;
    ifs.open(gps_path);
    if (!ifs.is_open())
    {
        std::cerr << "Can not open gps.txt!" << std::endl;
        exit(-1);
    }
    while (!ifs.eof())
    {
        std::string image_name;
        cv::Point3d temp_gps;
        ifs >> image_name >> std::setprecision(12) >> temp_gps.x >> temp_gps.y >> temp_gps.z;
        all_gps_data[image_name] = temp_gps;
    }
}

 

c++ 读取txt文件

上一篇:奇牛C++从入门到精通-高级程序员之路


下一篇:Photoshop调出小清新日系效果的蒲草植物图片