请教 GetPrivateProfileSectionNames()用法(在线,解决给分!)
读取ini文件,例如:
[section1]
value1=....;
value2=....;
[section2]
value1=....;
value2=....;
我不知道[sectioni]的名称和数量。查msdn发现GetPrivateProfileSectionNames()
可以达到目的。
我的程序如下:
char section[256];
GetPrivateProfileSectionNames(
section, // return buffer
256, // size of return buffer
datafile.c_str() // initialization file name
);
但只能返回第一个section的值,
请大家帮忙!!!