benhoyt / inih

Simple .INI file parser in C, good for embedded systems

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is is possible to save data into .ini file?

smartechru opened this issue · comments

Hello,

Thank you for your great repository.
Is there any code to save data into .ini file?
I've checked the library but couldn't find this part.
It would be great if you add this functionality.

My best.

No, inih is just a parser/reader, and I don't really have plans to add writing, sorry.

However, writing is generally quite straight-forward as you can often just use fprintf directly, for example:

fprintf(f, "[user]\n");
fprintf(f, "name = %s\n", config.name);
fprintf(f, "email = %s\n", config.email);
fprintf(f, "age = %d\n", config.age);