C++中格式读取文件中的参数
参数文件parameters.txt大概是这样的形式
#Parameters
#sampling rate of frames(reference value:2-10)
samplingRate 2
#mode of feature extraction
#7-12(general: 10)
videoSampleFeatureMode 13
videoSearchingFeatureMode 10
#/home/lumeiqi/projects/newVideoRetrieval attention the enter key
videoPath ../testvideo/test.mp4
其中#开头行代表注释,参数值有整数有字符串,记录读取代码,备忘
代码如下:
#include "Parameters.h"
#include <fstream>
#include <string>
#include <sstream>
#include <stdexcept>
#include <iostream>
<