栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

tests

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

tests

#include
#include
#include
#include
using namespace std;
String file_path = “./…/HikCameraPara.txt”; // 相机参数文件路径

// 读取相机参数文件
int readParaFile(int key) {
char buffer[256];
int num = 0;
int value;
ifstream in(file_path); // 生成根目录为可执行文件
if (! in.is_open()) // 使用默认参数表
{ cout << “Error opening file”;exit (1); }
while (!in.eof() )
{
num++;
in.getline (buffer,100);
if (key == num){ // 读取指定文件
cout << “sdfse:”< return value;
}
}
in.close();
return value;
}

// 相机参数写入文件【相机调试模式下有效】
int writeParaFile(int key) {
fstream out(file_path); // 生成根目录为可执行文件
if (out.is_open())
{
out << “This is a line.”;
out << “This is another line.n”;
out.close();
}
else{
ofstream out_data;
out_data.open(file_path, ios::app);
out_data.close();
cout << “相机参数文件创建成功” << endl;
}
return 0;
}

readParaFile(2);

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/513040.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号