C++配置文件相关

Posted on 2019-12-19 13:48  yacbo  阅读(147)  评论(0)    收藏  举报

1.

#ifndef COMMON_H
#define COMMON_H
typedef struct _StructConfig{
    std::string file_name;
}StructConfig;
extern StructConfig sConfig;
#endif
Config configSettings("../config.ini");
sConfig.file_name = configSettings.Read("file_name", sConfig.file_name);
#config.ini文件
file_name=../test.mp4

 

博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3