【C++】 C++ 配置文件读取数组:读取 int[], float[], string[],bool[];读取 int, float, string,bool;错误输出,长度判定等

文章目录

  • 1 读取 int, float, string,bool
  • 2 读取 int[], float[], string[],bool[]
  • 3 完整代码
    • 3.1 头文件
    • 3.2 .cpp文件
  • 4 .实例 调用
  • 5 错误

主要功能

  • 1.读取 int, float, string,bool(getInt, getFloat, getString,getBool)。
  • 2.读取 int, float, string 数组(getIntArray, getFloatArray, getStringArray,getBoolArray)。
  • 3.自动判断数组长度。
  • 4.bool 类型大小写不敏感(true/false、TRUE/FALSE、TrUe/FaLsE 都可正确解析)

配置文件示例

[imgPro]
//int
times = 3
//float
ratio =

你可能感兴趣的:(OpenCV,C++,C/C++,C++,c++,读取配置文件,配置文件读数组,读取int[],读取float[],读取string[],读取bool[])