首页 > 编程语言 > 详细

c++ 读取txt文件

时间:2021-09-04 02:57:09      阅读:12      评论:0      收藏:0      [点我收藏+]
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文件

原文:https://www.cnblogs.com/lockingball/p/15221994.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!