C ++ configuration file related

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 
file_name = .. / test.mp4

 

Guess you like

Origin www.cnblogs.com/mathyk/p/12067303.html