如何创建配置文件并在 C 中访问它?

How to Create a Config File and access it in C?

这是我第一次尝试用 C 语言创建配置文件。我之前在 Python 中做过。为了在 python 中开发它,我使用了以下 link。有人能告诉我用 C 语言做这个的方法吗?

我要创建的是一个配置文件,其中包含按钮的特定状态列表、不同的应用程序名称等,并从我的主 C 程序访问它们?

我没有在这里添加任何代码,因为我不知道如何在 c 中创建配置文件。请帮忙

libconfig for example. If your config file is something custom with not too complicated structure, you also can write it on your own, obviously. Googling for "c file IO" will point you in the right directions. XML would also be a idea, if the data is very complex. For example: link.